about summary refs log tree commit diff
path: root/nixos/modules/services/backup
diff options
context:
space:
mode:
authorLassulus <github@lassul.us>2023-03-22 00:37:46 +0700
committerGitHub <noreply@github.com>2023-03-22 00:37:46 +0700
commit3839340fdbb78f528602a40828fdbaacccc716ea (patch)
tree4045bf6e417ba86420285aa77e56514f95c18f94 /nixos/modules/services/backup
parent0b3b9536bcc335104a4fb03e9ac15015d18b50cb (diff)
parentadafbeff4ad01e21b9d1b39f072298978c08aa6c (diff)
downloadnixlib-3839340fdbb78f528602a40828fdbaacccc716ea.tar
nixlib-3839340fdbb78f528602a40828fdbaacccc716ea.tar.gz
nixlib-3839340fdbb78f528602a40828fdbaacccc716ea.tar.bz2
nixlib-3839340fdbb78f528602a40828fdbaacccc716ea.tar.lz
nixlib-3839340fdbb78f528602a40828fdbaacccc716ea.tar.xz
nixlib-3839340fdbb78f528602a40828fdbaacccc716ea.tar.zst
nixlib-3839340fdbb78f528602a40828fdbaacccc716ea.zip
Merge pull request #220656 from oxzi/restic-cache-fix
nixos/restic: generalize cache configuration
Diffstat (limited to 'nixos/modules/services/backup')
-rw-r--r--nixos/modules/services/backup/restic.nix7
1 files changed, 4 insertions, 3 deletions
diff --git a/nixos/modules/services/backup/restic.nix b/nixos/modules/services/backup/restic.nix
index bc24e13aa050..ca796cf7797e 100644
--- a/nixos/modules/services/backup/restic.nix
+++ b/nixos/modules/services/backup/restic.nix
@@ -303,8 +303,8 @@ in
               then if (backup.paths != null) then concatStringsSep " " backup.paths else ""
               else "--files-from ${filesFromTmpFile}";
             pruneCmd = optionals (builtins.length backup.pruneOpts > 0) [
-              (resticCmd + " forget --prune --cache-dir=%C/restic-backups-${name} " + (concatStringsSep " " backup.pruneOpts))
-              (resticCmd + " check --cache-dir=%C/restic-backups-${name} " + (concatStringsSep " " backup.checkOpts))
+              (resticCmd + " forget --prune " + (concatStringsSep " " backup.pruneOpts))
+              (resticCmd + " check " + (concatStringsSep " " backup.checkOpts))
             ];
             # Helper functions for rclone remotes
             rcloneRemoteName = builtins.elemAt (splitString ":" backup.repository) 1;
@@ -314,6 +314,7 @@ in
           in
           nameValuePair "restic-backups-${name}" ({
             environment = {
+              RESTIC_CACHE_DIR = "%C/restic-backups-${name}";
               RESTIC_PASSWORD_FILE = backup.passwordFile;
               RESTIC_REPOSITORY = backup.repository;
               RESTIC_REPOSITORY_FILE = backup.repositoryFile;
@@ -332,7 +333,7 @@ in
             restartIfChanged = false;
             serviceConfig = {
               Type = "oneshot";
-              ExecStart = (optionals (backupPaths != "") [ "${resticCmd} backup --cache-dir=%C/restic-backups-${name} ${concatStringsSep " " (backup.extraBackupArgs ++ excludeFlags)} ${backupPaths}" ])
+              ExecStart = (optionals (backupPaths != "") [ "${resticCmd} backup ${concatStringsSep " " (backup.extraBackupArgs ++ excludeFlags)} ${backupPaths}" ])
                 ++ pruneCmd;
               User = backup.user;
               RuntimeDirectory = "restic-backups-${name}";