summaryrefslogtreecommitdiff
path: root/custom/borgbackup.nix
diff options
context:
space:
mode:
Diffstat (limited to 'custom/borgbackup.nix')
-rw-r--r--custom/borgbackup.nix3
1 files changed, 1 insertions, 2 deletions
diff --git a/custom/borgbackup.nix b/custom/borgbackup.nix
index 781f094a..95b3ce24 100644
--- a/custom/borgbackup.nix
+++ b/custom/borgbackup.nix
@@ -59,14 +59,13 @@ in {
59 config = mkIf (any (t: t.paths != []) (attrValues cfg.targets)) { 59 config = mkIf (any (t: t.paths != []) (attrValues cfg.targets)) {
60 services.btrfs-snapshots.enable = mkIf (cfg.snapshots == "btrfs") true; 60 services.btrfs-snapshots.enable = mkIf (cfg.snapshots == "btrfs") true;
61 61
62 systemd.timers = (listToAttrs (map ({ target, path, tCfg }: nameValuePair "borgbackup-${target}-${path}" { 62 systemd.timers = (listToAttrs (map ({ target, path, tCfg }: nameValuePair "borgbackup-${target}@${path}" {
63 wantedBy = [ "timers.target" ]; 63 wantedBy = [ "timers.target" ];
64 64
65 timerConfig = { 65 timerConfig = {
66 Persistent = false; 66 Persistent = false;
67 OnBootSec = tCfg.interval; 67 OnBootSec = tCfg.interval;
68 OnUnitInactiveSec = tCfg.interval; 68 OnUnitInactiveSec = tCfg.interval;
69 Unit = "borgbackup-${target}@${path}.service";
70 }; 69 };
71 }) (flatten (mapAttrsToList (target: tCfg: map (path: { inherit target path tCfg; }) tCfg.paths) cfg.targets)))) // (mapAttrs' (target: tCfg: nameValuePair "borgbackup-prune-${target}" { 70 }) (flatten (mapAttrsToList (target: tCfg: map (path: { inherit target path tCfg; }) tCfg.paths) cfg.targets)))) // (mapAttrs' (target: tCfg: nameValuePair "borgbackup-prune-${target}" {
72 wantedBy = [ "timers.target" ]; 71 wantedBy = [ "timers.target" ];