diff options
author | Chuck <chuck@intelligence.org> | 2019-09-10 23:00:58 -0700 |
---|---|---|
committer | Chuck <chuck@intelligence.org> | 2019-09-12 06:35:37 -0700 |
commit | b6c97cadc2e850d054a56eee6c714bd31fffd0e1 (patch) | |
tree | ed466e025c350e72cf037bca5b1dcb1e1547908b /nixos/modules/config | |
parent | b425012fdf450e7b3397d5a3d28d6091de24546f (diff) |
nixos/shells-environment: Make ~/bin/ in $PATH optional
Diffstat (limited to 'nixos/modules/config')
-rw-r--r-- | nixos/modules/config/shells-environment.nix | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/nixos/modules/config/shells-environment.nix b/nixos/modules/config/shells-environment.nix index 9dfc1add8299..ba89784033e6 100644 --- a/nixos/modules/config/shells-environment.nix +++ b/nixos/modules/config/shells-environment.nix @@ -118,6 +118,14 @@ in type = with types; attrsOf (nullOr (either str path)); }; + environment.homeBinInPath = mkOption { + description = '' + Include ~/bin/ in $PATH. + ''; + default = true; + type = types.bool; + }; + environment.binsh = mkOption { default = "${config.system.build.binsh}/bin/sh"; defaultText = "\${config.system.build.binsh}/bin/sh"; @@ -184,8 +192,10 @@ in ${cfg.extraInit} - # ~/bin if it exists overrides other bin directories. - export PATH="$HOME/bin:$PATH" + ${optionalString cfg.homeBinInPath '' + # ~/bin if it exists overrides other bin directories. + export PATH="$HOME/bin:$PATH" + ''} ''; system.activationScripts.binsh = stringAfter [ "stdio" ] |