summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Marshall <andrew@johnandrewmarshall.com>2024-05-22 13:43:33 -0400
committerAndrew Marshall <andrew@johnandrewmarshall.com>2024-05-23 09:55:35 -0400
commitbd0ed8599fd4871e79543e09075dac2c2c25ff2a (patch)
tree5f6bdd67bb46e885b3d0443a370af423e9abade5 /tests
parent9b6f77200f8a88c8b5e5da47e90b73f86aab27b9 (diff)
environment: Test how order of systemPath and profiles manifests
Diffstat (limited to 'tests')
-rw-r--r--tests/environment-path.nix18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/environment-path.nix b/tests/environment-path.nix
index 5ddaf9c..0bb9a05 100644
--- a/tests/environment-path.nix
+++ b/tests/environment-path.nix
@@ -3,19 +3,37 @@
with lib;
{
+ environment.systemPath = mkMerge [
+ (mkBefore [ "beforePath" ])
+ [ "myPath" ]
+ (mkAfter [ "afterPath" ])
+ ];
+
+ environment.profiles = mkMerge [
+ (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"
]}"
'';
}