Merge pull request #273834 from ajs124/restic-wrappers-append-path

nixos/restic: append PATH in wrappers instead of overwriting
This commit is contained in:
Janik 2023-12-13 23:15:50 +01:00 committed by GitHub
commit 27bcbd780f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);