about summary refs log tree commit diff
path: root/nixos/modules/services/backup
diff options
context:
space:
mode:
authorajs124 <git@ajs124.de>2023-12-12 22:17:06 +0100
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2023-12-13 22:16:19 +0000
commite15f2d7583b95af41ff7456858a53a1d15f388dc (patch)
treedbfcfe364d7e105f3fe330b2f4dc1c4e43f4e32e /nixos/modules/services/backup
parentb8d5b5ea350bd2d48b05f7cfaec55c89159d0612 (diff)
nixos/restic: append PATH in wrappers instead of overwriting
fixes "mount"

(cherry picked from commit be0a6b0dd6b72667a930a8e26bf4ae9e99b311a5)
Diffstat (limited to 'nixos/modules/services/backup')
-rw-r--r--nixos/modules/services/backup/restic.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/nixos/modules/services/backup/restic.nix b/nixos/modules/services/backup/restic.nix
index 87595f39796d9..d7cd6a29c52c6 100644
--- a/nixos/modules/services/backup/restic.nix
+++ b/nixos/modules/services/backup/restic.nix
@@ -391,10 +391,11 @@ in
       ${lib.optionalString (backup.environmentFile != null) "source ${backup.environmentFile}"}
       # set same environment variables as the systemd service
       ${lib.pipe config.systemd.services."restic-backups-${name}".environment [
-        (lib.filterAttrs (_: v: v != null))
+        (lib.filterAttrs (n: v: v != null && n != "PATH"))
         (lib.mapAttrsToList (n: v: "${n}=${v}"))
         (lib.concatStringsSep "\n")
       ]}
+      PATH=${config.systemd.services."restic-backups-${name}".environment.PATH}:$PATH
 
       exec ${resticCmd} $@
     '') (lib.filterAttrs (_: v: v.createWrapper) config.services.restic.backups);