about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorJanik <80165193+Janik-Haag@users.noreply.github.com>2023-12-13 23:15:50 +0100
committerGitHub <noreply@github.com>2023-12-13 23:15:50 +0100
commit27bcbd780fc8f56ff6ac34c3d37ec5bffa8aa3ad (patch)
treee7b5ffcf58c471371a3bc1c12a7a7112b31da781 /nixos/modules
parentdc92ffa69cd5278bc68b3469b48d350db8355cfa (diff)
parentbe0a6b0dd6b72667a930a8e26bf4ae9e99b311a5 (diff)
Merge pull request #273834 from ajs124/restic-wrappers-append-path
nixos/restic: append PATH in wrappers instead of overwriting
Diffstat (limited to 'nixos/modules')
-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 e3eb504e0adfc..b222dd952d159 100644
--- a/nixos/modules/services/backup/restic.nix
+++ b/nixos/modules/services/backup/restic.nix
@@ -384,10 +384,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);