diff options
author | Gregor Kleen <gkleen@yggdrasil.li> | 2021-01-02 21:44:21 +0100 |
---|---|---|
committer | Gregor Kleen <gkleen@yggdrasil.li> | 2021-01-03 16:21:34 +0100 |
commit | 3b5ab82fa714a0d483a7b90d60f9f7c857646e33 (patch) | |
tree | 0aa24694ff2f4079c325e6eda18e3a6259b6b700 /modules/borgbackup/default.nix | |
parent | eb2cb6f263dffb82da86372b14d6fcd7077fe9fe (diff) | |
download | nixos-3b5ab82fa714a0d483a7b90d60f9f7c857646e33.tar nixos-3b5ab82fa714a0d483a7b90d60f9f7c857646e33.tar.gz nixos-3b5ab82fa714a0d483a7b90d60f9f7c857646e33.tar.bz2 nixos-3b5ab82fa714a0d483a7b90d60f9f7c857646e33.tar.xz nixos-3b5ab82fa714a0d483a7b90d60f9f7c857646e33.zip |
sif: borgbackup
Diffstat (limited to 'modules/borgbackup/default.nix')
-rw-r--r-- | modules/borgbackup/default.nix | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/borgbackup/default.nix b/modules/borgbackup/default.nix index 47f8e06d..a0419d0e 100644 --- a/modules/borgbackup/default.nix +++ b/modules/borgbackup/default.nix | |||
@@ -65,6 +65,11 @@ let | |||
65 | type = types.int; | 65 | type = types.int; |
66 | default = 600; | 66 | default = 600; |
67 | }; | 67 | }; |
68 | |||
69 | keyFile = mkOption { | ||
70 | type = types.nullOr types.path; | ||
71 | default = null; | ||
72 | }; | ||
68 | }; | 73 | }; |
69 | }; | 74 | }; |
70 | in { | 75 | in { |
@@ -171,6 +176,7 @@ in { | |||
171 | IOSchedulingPriority = 7; | 176 | IOSchedulingPriority = 7; |
172 | SuccessExitStatus = [1 2]; | 177 | SuccessExitStatus = [1 2]; |
173 | Slice = "system-borgbackup.slice"; | 178 | Slice = "system-borgbackup.slice"; |
179 | Environment = lib.mkIf (tCfg.keyFile != null) "BORG_KEY_FILE=${tCfg.keyFile}"; | ||
174 | }; | 180 | }; |
175 | })) cfg.targets) // (mapAttrs' (target: tCfg: nameValuePair "borgbackup-prune-${target}" { | 181 | })) cfg.targets) // (mapAttrs' (target: tCfg: nameValuePair "borgbackup-prune-${target}" { |
176 | enable = tCfg.prune != {}; | 182 | enable = tCfg.prune != {}; |
@@ -193,6 +199,7 @@ in { | |||
193 | serviceConfig = { | 199 | serviceConfig = { |
194 | Type = "oneshot"; | 200 | Type = "oneshot"; |
195 | Slice = "system-borgbackup.slice"; | 201 | Slice = "system-borgbackup.slice"; |
202 | Environment = lib.mkIf (tCfg.keyFile != null) "BORG_KEY_FILE=${tCfg.keyFile}"; | ||
196 | }; | 203 | }; |
197 | }) cfg.targets); | 204 | }) cfg.targets); |
198 | }; | 205 | }; |