diff options
| author | Daiderd Jordan <daiderd@gmail.com> | 2017-05-15 19:22:44 +0200 |
|---|---|---|
| committer | Daiderd Jordan <daiderd@gmail.com> | 2017-05-15 19:46:34 +0200 |
| commit | 1b6f56f5b8042000a826ecba2ebe52a831e2df46 (patch) | |
| tree | 4dda5f9485d38401c588c9e374a0bae25f3e15a1 /modules/environment | |
| parent | c8ce901a43747eb79a986d90e016e5145dd0e616 (diff) | |
environment: include /usr/sbin and /sbin in systemPath
Don't extend initial PATH adding extra entries should be done through
appending environment.systemPath or manually extending it with
environment.extraInit or similar options.
Diffstat (limited to 'modules/environment')
| -rw-r--r-- | modules/environment/default.nix | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/modules/environment/default.nix b/modules/environment/default.nix index f982b25..492ff0a 100644 --- a/modules/environment/default.nix +++ b/modules/environment/default.nix @@ -12,6 +12,7 @@ let aliasCommands = mapAttrsFlatten (n: v: ''alias ${n}="${v}"'') cfg.shellAliases; + makeDrvBinPath = concatMapStringsSep ":" (p: if isDerivation p then "${p}/bin" else p); in { options = { @@ -34,7 +35,7 @@ in { environment.systemPath = mkOption { type = types.loeOf types.str; description = "The set of paths that are added to PATH."; - apply = x: if isList x then makeBinPath x else x; + apply = x: if isList x then makeDrvBinPath x else x; }; environment.profiles = mkOption { @@ -112,7 +113,7 @@ in { config = { - environment.systemPath = cfg.profiles ++ [ "/usr/local" "/usr" "" ]; + environment.systemPath = [ (makeBinPath cfg.profiles) "/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin" ]; environment.profiles = [ # Use user, default and system profiles. |
