Unverified Commit 27bcbd78 authored by Janik's avatar Janik Committed by GitHub
Browse files

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

nixos/restic: append PATH in wrappers instead of overwriting
parents dc92ffa6 be0a6b0d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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);