mirror of
https://github.com/LnL7/nix-darwin.git
synced 2025-03-13 20:30:02 +00:00
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.
This commit is contained in:
parent
c8ce901a43
commit
1b6f56f5b8
5 changed files with 8 additions and 7 deletions
|
@ -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.
|
||||
|
|
|
@ -63,7 +63,7 @@ in
|
|||
if [ -n "$__ETC_BASHRC_SOURCED" -o -n "$NOSYSBASHRC" ]; then return; fi
|
||||
__ETC_BASHRC_SOURCED=1
|
||||
|
||||
export PATH=${config.environment.systemPath}''${PATH:+:$PATH}
|
||||
export PATH=${config.environment.systemPath}
|
||||
${config.system.build.setEnvironment}
|
||||
${config.system.build.setAliases}
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ in
|
|||
|
||||
set fish_function_path $fish_function_path ${pkgs.fish-foreign-env}/share/fish-foreign-env/functions
|
||||
|
||||
set PATH ${replaceStrings [":"] [" "] config.environment.systemPath} $PATH
|
||||
set PATH ${replaceStrings [":"] [" "] config.environment.systemPath}
|
||||
|
||||
${config.system.build.setEnvironment}
|
||||
|
||||
|
|
|
@ -177,7 +177,7 @@ in
|
|||
|
||||
setopt HIST_IGNORE_DUPS SHARE_HISTORY HIST_FCNTL_LOCK
|
||||
|
||||
export PATH=${config.environment.systemPath}''${PATH:+:$PATH}
|
||||
export PATH=${config.environment.systemPath}
|
||||
${config.system.build.setEnvironment}
|
||||
${config.system.build.setAliases}
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ in
|
|||
#! ${stdenv.shell}
|
||||
set -e
|
||||
set -o pipefail
|
||||
export PATH=${pkgs.coreutils}/bin:${config.environment.systemPath}:$PATH
|
||||
export PATH=${pkgs.coreutils}/bin:${config.environment.systemPath}
|
||||
|
||||
systemConfig=@out@
|
||||
|
||||
|
@ -75,7 +75,7 @@ in
|
|||
#! ${stdenv.shell}
|
||||
set -e
|
||||
set -o pipefail
|
||||
export PATH=${pkgs.coreutils}/bin:${config.environment.systemPath}:$PATH
|
||||
export PATH=${pkgs.coreutils}/bin:${config.environment.systemPath}
|
||||
|
||||
systemConfig=@out@
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue