summaryrefslogtreecommitdiff
path: root/modules/borgbackup/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/borgbackup/default.nix')
-rw-r--r--modules/borgbackup/default.nix7
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 };
70in { 75in {
@@ -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 };