From fa3c444880d83e62e98c69b8e885f28dba3e6c11 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Tue, 14 Mar 2023 09:53:19 +0100 Subject: ... --- hosts/vidhar/borg/default.nix | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'hosts/vidhar/borg') diff --git a/hosts/vidhar/borg/default.nix b/hosts/vidhar/borg/default.nix index 9a51b103..922cbf02 100644 --- a/hosts/vidhar/borg/default.nix +++ b/hosts/vidhar/borg/default.nix @@ -45,6 +45,8 @@ let ]; }; }; + + baseDir = "/srv/backup/borg"; in { config = { services.borgsnap = { @@ -56,7 +58,7 @@ in { }; services.copyborg.jotnar = { - from = "/srv/backup/borg/jotnar"; + from = "${baseDir}/jotnar"; to = "yggdrasil.borgbase:repo"; inherit sshConfig; keyfile = config.sops.secrets."yggdrasil.borgkey".path; @@ -67,14 +69,14 @@ in { services.borgbackup.repos = { jotnar = { - path = "/srv/backup/borg/jotnar"; + path = "${baseDir}/jotnar"; authorizedKeysAppendOnly = let dir = ./jotnar; toAuthKey = fname: ftype: if ftype != "regular" || !(hasSuffix ".pub" fname) then null else builtins.readFile (dir + "/${fname}"); in filter (v: v != null) (mapAttrsToList toAuthKey (builtins.readDir dir)); }; "uniworx.de" = { - path = "/srv/backups/borg/uniworx.de"; + path = "${baseDir}/uniworx.de"; authorizedKeys = [ (builtins.readFile ./uniworx.de/root.pub) ]; @@ -84,7 +86,7 @@ in { }; }; - # systemd.services."check-borg@${utils.escapeSystemdPath "/srv/backup/borg/jotnar"}" = checkBorgUnit; + # systemd.services."check-borg@${utils.escapeSystemdPath "${baseDir}/jotnar"}" = checkBorgUnit; # systemd.services."check-borg@${utils.escapeSystemdPath "yggdrasil.borgbase:repo"}" = recursiveUpdate checkBorgUnit { # serviceConfig = { # Environment = checkBorgUnit.serviceConfig.Environment ++ [ @@ -92,7 +94,7 @@ in { # ]; # }; # }; - # systemd.timers."check-borg@${utils.escapeSystemdPath "/srv/backup/borg/jotnar"}" = { + # systemd.timers."check-borg@${utils.escapeSystemdPath "${baseDir}/jotnar"}" = { # wantedBy = [ "timers.target" ]; # timerConfig = { # OnCalendar = "*-*-* 00:30:00 UTC"; @@ -106,7 +108,7 @@ in { # }; boot.postBootCommands = mkBefore '' - ${pkgs.findutils}/bin/find /srv/backup/borg -type d -empty -delete + ${pkgs.findutils}/bin/find ${baseDir} -type d -empty -delete ''; users.users.borg.extraGroups = ["ssh"]; -- cgit v1.2.3