diff options
| author | Mike Vink <59492084+ivi-vink@users.noreply.github.com> | 2025-01-16 22:22:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-16 22:22:34 +0100 |
| commit | 8e7bd91f353caacc0bc4105f573eb3e17f09e03a (patch) | |
| tree | c5059edcbebd9644290cad7c653c49a36d593021 /tests/environment-path.nix | |
| parent | 6bd39d420578aacf7c0bab7de3e7027b952115ae (diff) | |
| parent | bd921223ba7cdac346477d7ea5204d6f4736fcc6 (diff) | |
Diffstat (limited to 'tests/environment-path.nix')
| -rw-r--r-- | tests/environment-path.nix | 34 |
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" + ]}" ''; } |
