mirror of
https://github.com/LnL7/nix-darwin.git
synced 2024-12-14 11:57:34 +00:00
environment: Rework test to assert against full $PATH
It’s deterministic after all, so test against the full thing for greater flexibility in testing and confidence in lack of unexpected changes to previously-untested parts of the default $PATH. Do this in a subshell to avoid polluting the test script’s environment.
This commit is contained in:
parent
eac4f25028
commit
9b6f77200f
1 changed files with 12 additions and 4 deletions
|
@ -4,10 +4,18 @@ with lib;
|
||||||
|
|
||||||
{
|
{
|
||||||
test = ''
|
test = ''
|
||||||
echo checking /run/current-system/sw/bin in environment >&2
|
echo 'checking PATH' >&2
|
||||||
grep 'export PATH=.*:/run/current-system/sw/bin' ${config.system.build.setEnvironment}
|
env_path=$(bash -c 'source ${config.system.build.setEnvironment}; echo $PATH')
|
||||||
|
|
||||||
echo checking /bin and /sbin in environment >&2
|
test "$env_path" = "${builtins.concatStringsSep ":" [
|
||||||
grep 'export PATH=.*:/usr/bin:/usr/sbin:/bin:/sbin' ${config.system.build.setEnvironment}
|
"/homeless-shelter/.nix-profile/bin"
|
||||||
|
"/run/current-system/sw/bin"
|
||||||
|
"/nix/var/nix/profiles/default/bin"
|
||||||
|
"/usr/local/bin"
|
||||||
|
"/usr/bin"
|
||||||
|
"/usr/sbin"
|
||||||
|
"/bin"
|
||||||
|
"/sbin"
|
||||||
|
]}"
|
||||||
'';
|
'';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue