Skip to content

Commit

Permalink
Merge pull request #274075 from NixOS/backport-273834-to-release-23.11
Browse files Browse the repository at this point in the history
[Backport release-23.11] nixos/restic: append PATH in wrappers instead of overwriting
  • Loading branch information
NickCao authored Dec 14, 2023
2 parents cbf9197 + e15f2d7 commit c777f55
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nixos/modules/services/backup/restic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c777f55

Please sign in to comment.