From 3d13a0136fb33a5fd4b592c3935caff668c7c75f Mon Sep 17 00:00:00 2001 From: clerie Date: Sat, 1 Jul 2023 13:08:49 +0200 Subject: [PATCH] modules/backup: add restic cache --- modules/backup/default.nix | 4 ++++ 1 file changed, 4 insertions(+) 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 - - - - -" + ]; }; }