summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorAndrew Marshall <andrew@johnandrewmarshall.com>2024-05-22 09:41:12 -0400
committerAndrew Marshall <andrew@johnandrewmarshall.com>2024-05-23 09:55:35 -0400
commit7f897008d4f3c7dda86e19106169eb947a0ac308 (patch)
treeeaf14d5cc1fb65b6012f03eeb409d7710d596aa1 /modules
parentbd0ed8599fd4871e79543e09075dac2c2c25ff2a (diff)
environment: Adjust systemPath order to allow injecting in the middle
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.
Diffstat (limited to 'modules')
-rw-r--r--modules/environment/default.nix5
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/environment/default.nix b/modules/environment/default.nix
index 753ee31..bb99622 100644
--- a/modules/environment/default.nix
+++ b/modules/environment/default.nix
@@ -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 [