Skip to content

Commit

Permalink
environment: Adjust systemPath order to allow injecting in the middle
Browse files Browse the repository at this point in the history
Previously, it was not possible to inject PATH entries between profiles
and the “default system” PATH entries. This confounds adding, e.g.
Homebrew on aarch64’s non-standard prefix as higher priority than the
builtin system paths, but lower than Nix profiles.

This is a backwards-incompatible change for some users, but should only
be so in the case a user used `mkOrder` with a value between 1000 (the
default priority) and 1200. Value of 1200 chosen as the same delta from
the default as just below in `environment.profiles` (which uses 800),
and mkAfter is 1500 so will still go after this.
  • Loading branch information
amarshall committed May 23, 2024
1 parent bd0ed85 commit 7f89700
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/environment/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,10 @@ in

config = {

environment.systemPath = [ (makeBinPath cfg.profiles) "/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin" ];
environment.systemPath = mkMerge [
[ (makeBinPath cfg.profiles) ]
(mkOrder 1200 [ "/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin" ])
];

# Use user, default and system profiles.
environment.profiles = mkMerge [
Expand Down

0 comments on commit 7f89700

Please sign in to comment.