mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-16 05:18:17 +00:00
Merge pull request #956 from amarshall/systempath-order
environment: Adjust systemPath order to allow injecting in the middle
This commit is contained in:
commit
0bea8222f6
2 changed files with 35 additions and 6 deletions
|
@ -151,7 +151,10 @@ in
|
||||||
|
|
||||||
config = {
|
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.
|
# Use user, default and system profiles.
|
||||||
environment.profiles = mkMerge [
|
environment.profiles = mkMerge [
|
||||||
|
|
|
@ -3,11 +3,37 @@
|
||||||
with lib;
|
with lib;
|
||||||
|
|
||||||
{
|
{
|
||||||
test = ''
|
environment.systemPath = mkMerge [
|
||||||
echo checking /run/current-system/sw/bin in environment >&2
|
(mkBefore [ "beforePath" ])
|
||||||
grep 'export PATH=.*:/run/current-system/sw/bin' ${config.system.build.setEnvironment}
|
[ "myPath" ]
|
||||||
|
(mkAfter [ "afterPath" ])
|
||||||
|
];
|
||||||
|
|
||||||
echo checking /bin and /sbin in environment >&2
|
environment.profiles = mkMerge [
|
||||||
grep 'export PATH=.*:/usr/bin:/usr/sbin:/bin:/sbin' ${config.system.build.setEnvironment}
|
(mkBefore [ "beforeProfile" ])
|
||||||
|
[ "myProfile" ]
|
||||||
|
(mkAfter [ "afterProfile" ])
|
||||||
|
];
|
||||||
|
|
||||||
|
test = ''
|
||||||
|
echo 'checking PATH' >&2
|
||||||
|
env_path=$(bash -c 'source ${config.system.build.setEnvironment}; echo $PATH')
|
||||||
|
|
||||||
|
test "$env_path" = "${builtins.concatStringsSep ":" [
|
||||||
|
"beforePath"
|
||||||
|
"myPath"
|
||||||
|
"beforeProfile/bin"
|
||||||
|
"/homeless-shelter/.nix-profile/bin"
|
||||||
|
"myProfile/bin"
|
||||||
|
"/run/current-system/sw/bin"
|
||||||
|
"/nix/var/nix/profiles/default/bin"
|
||||||
|
"afterProfile/bin"
|
||||||
|
"/usr/local/bin"
|
||||||
|
"/usr/bin"
|
||||||
|
"/usr/sbin"
|
||||||
|
"/bin"
|
||||||
|
"/sbin"
|
||||||
|
"afterPath"
|
||||||
|
]}"
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue