mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
bash: do not export HIST* variables
These are interpreted by the shell itself and it does not make sense to export them to sub-processes.
This commit is contained in:
parent
78c308c835
commit
8ab6298f30
1 changed files with 5 additions and 6 deletions
|
@ -132,8 +132,7 @@ in
|
|||
);
|
||||
|
||||
export = n: v: "export ${n}=\"${toString v}\"";
|
||||
exportIfNonNull = n: v: optionalString (v != null) (export n v);
|
||||
exportIfNonEmpty = n: v: optionalString (v != "") (export n v);
|
||||
setIfNonEmpty = n: v: optionalString (v != "") "${n}=${toString v}";
|
||||
|
||||
histControlStr = concatStringsSep ":" cfg.historyControl;
|
||||
histIgnoreStr = concatStringsSep ":" cfg.historyIgnore;
|
||||
|
@ -153,10 +152,10 @@ in
|
|||
programs.bash.bashrcExtra = ''
|
||||
# Commands that should be applied only for interactive shells.
|
||||
if [[ -n $PS1 ]]; then
|
||||
${export "HISTSIZE" cfg.historySize}
|
||||
${export "HISTFILESIZE" cfg.historyFileSize}
|
||||
${exportIfNonEmpty "HISTCONTROL" histControlStr}
|
||||
${exportIfNonEmpty "HISTIGNORE" histIgnoreStr}
|
||||
HISTSIZE=${toString cfg.historySize}
|
||||
HISTFILESIZE=${toString cfg.historyFileSize}
|
||||
${setIfNonEmpty "HISTCONTROL" histControlStr}
|
||||
${setIfNonEmpty "HISTIGNORE" histIgnoreStr}
|
||||
|
||||
${shoptsStr}
|
||||
|
||||
|
|
Loading…
Reference in a new issue