2017-05-15 18:35:30 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
{
|
2024-05-22 17:43:33 +00:00
|
|
|
environment.systemPath = mkMerge [
|
|
|
|
(mkBefore [ "beforePath" ])
|
|
|
|
[ "myPath" ]
|
|
|
|
(mkAfter [ "afterPath" ])
|
|
|
|
];
|
|
|
|
|
|
|
|
environment.profiles = mkMerge [
|
|
|
|
(mkBefore [ "beforeProfile" ])
|
|
|
|
[ "myProfile" ]
|
|
|
|
(mkAfter [ "afterProfile" ])
|
|
|
|
];
|
|
|
|
|
2017-05-15 18:35:30 +00:00
|
|
|
test = ''
|
2024-05-22 17:34:01 +00:00
|
|
|
echo 'checking PATH' >&2
|
|
|
|
env_path=$(bash -c 'source ${config.system.build.setEnvironment}; echo $PATH')
|
2017-05-15 18:35:30 +00:00
|
|
|
|
2024-05-22 17:34:01 +00:00
|
|
|
test "$env_path" = "${builtins.concatStringsSep ":" [
|
2024-05-22 17:43:33 +00:00
|
|
|
"beforePath"
|
|
|
|
"myPath"
|
|
|
|
"beforeProfile/bin"
|
2024-05-22 17:34:01 +00:00
|
|
|
"/homeless-shelter/.nix-profile/bin"
|
2024-05-22 17:43:33 +00:00
|
|
|
"myProfile/bin"
|
2024-05-22 17:34:01 +00:00
|
|
|
"/run/current-system/sw/bin"
|
|
|
|
"/nix/var/nix/profiles/default/bin"
|
2024-05-22 17:43:33 +00:00
|
|
|
"afterProfile/bin"
|
2024-05-22 17:34:01 +00:00
|
|
|
"/usr/local/bin"
|
|
|
|
"/usr/bin"
|
|
|
|
"/usr/sbin"
|
|
|
|
"/bin"
|
|
|
|
"/sbin"
|
2024-05-22 17:43:33 +00:00
|
|
|
"afterPath"
|
2024-05-22 17:34:01 +00:00
|
|
|
]}"
|
2017-05-15 18:35:30 +00:00
|
|
|
'';
|
|
|
|
}
|