diff --git a/modules/backup/default.nix b/modules/backup/default.nix index 9d5ce3b..64d0e71 100644 --- a/modules/backup/default.nix +++ b/modules/backup/default.nix @@ -41,6 +41,7 @@ let export RESTIC_PASSWORD_FILE=${jobPasswordFile} export RESTIC_REPOSITORY="rest:https://${targetUsername}:$(cat ${targetPasswordFile})@${targetOptions.serverName}${repoPath}" export RESTIC_PROGRESS_FPS=0.1 + export RESTIC_CACHE_DIR=/var/cache/restic restic snapshots || restic init @@ -125,5 +126,8 @@ in config = mkIf cfg.enable { systemd.services = backupServiceUnits; systemd.timers = backupServiceTimers; + systemd.tmpfiles.rules = [ + "d /var/cache/restic - - - - -" + ]; }; }