summaryrefslogtreecommitdiff
path: root/tests/environment-path.nix
diff options
context:
space:
mode:
authorMike Vink <59492084+ivi-vink@users.noreply.github.com>2025-01-16 22:22:34 +0100
committerGitHub <noreply@github.com>2025-01-16 22:22:34 +0100
commit8e7bd91f353caacc0bc4105f573eb3e17f09e03a (patch)
treec5059edcbebd9644290cad7c653c49a36d593021 /tests/environment-path.nix
parent6bd39d420578aacf7c0bab7de3e7027b952115ae (diff)
parentbd921223ba7cdac346477d7ea5204d6f4736fcc6 (diff)
Merge branch 'LnL7:master' into masterHEADmaster
Diffstat (limited to 'tests/environment-path.nix')
-rw-r--r--tests/environment-path.nix34
1 files changed, 30 insertions, 4 deletions
diff --git a/tests/environment-path.nix b/tests/environment-path.nix
index 7d2f46d..0bb9a05 100644
--- a/tests/environment-path.nix
+++ b/tests/environment-path.nix
@@ -3,11 +3,37 @@
with lib;
{
+ environment.systemPath = mkMerge [
+ (mkBefore [ "beforePath" ])
+ [ "myPath" ]
+ (mkAfter [ "afterPath" ])
+ ];
+
+ environment.profiles = mkMerge [
+ (mkBefore [ "beforeProfile" ])
+ [ "myProfile" ]
+ (mkAfter [ "afterProfile" ])
+ ];
+
test = ''
- echo checking /run/current-system/sw/bin in environment >&2
- grep 'export PATH=.*:/run/current-system/sw/bin' ${config.system.build.setEnvironment}
+ echo 'checking PATH' >&2
+ env_path=$(bash -c 'source ${config.system.build.setEnvironment}; echo $PATH')
- echo checking /bin and /sbin in environment >&2
- grep 'export PATH=.*:/usr/bin:/usr/sbin:/bin:/sbin' ${config.system.build.setEnvironment}
+ 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"
+ ]}"
'';
}