From e15f2d7583b95af41ff7456858a53a1d15f388dc Mon Sep 17 00:00:00 2001 From: ajs124 Date: Tue, 12 Dec 2023 22:17:06 +0100 Subject: [PATCH] nixos/restic: append PATH in wrappers instead of overwriting fixes "mount" (cherry picked from commit be0a6b0dd6b72667a930a8e26bf4ae9e99b311a5) --- nixos/modules/services/backup/restic.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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);