nixos/shells-environment: Make ~/bin/ in $PATH optional
This commit is contained in:
parent
b425012fdf
commit
b6c97cadc2
@ -118,6 +118,14 @@ in
|
|||||||
type = with types; attrsOf (nullOr (either str path));
|
type = with types; attrsOf (nullOr (either str path));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
environment.homeBinInPath = mkOption {
|
||||||
|
description = ''
|
||||||
|
Include ~/bin/ in $PATH.
|
||||||
|
'';
|
||||||
|
default = true;
|
||||||
|
type = types.bool;
|
||||||
|
};
|
||||||
|
|
||||||
environment.binsh = mkOption {
|
environment.binsh = mkOption {
|
||||||
default = "${config.system.build.binsh}/bin/sh";
|
default = "${config.system.build.binsh}/bin/sh";
|
||||||
defaultText = "\${config.system.build.binsh}/bin/sh";
|
defaultText = "\${config.system.build.binsh}/bin/sh";
|
||||||
@ -184,8 +192,10 @@ in
|
|||||||
|
|
||||||
${cfg.extraInit}
|
${cfg.extraInit}
|
||||||
|
|
||||||
# ~/bin if it exists overrides other bin directories.
|
${optionalString cfg.homeBinInPath ''
|
||||||
export PATH="$HOME/bin:$PATH"
|
# ~/bin if it exists overrides other bin directories.
|
||||||
|
export PATH="$HOME/bin:$PATH"
|
||||||
|
''}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
system.activationScripts.binsh = stringAfter [ "stdio" ]
|
system.activationScripts.binsh = stringAfter [ "stdio" ]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user