From 8ab6298f305922f2e9871141ce0674144ab5b32e Mon Sep 17 00:00:00 2001 From: Robert Helgesson Date: Sun, 7 Jan 2018 16:54:29 +0100 Subject: [PATCH] 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. --- modules/programs/bash.nix | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/modules/programs/bash.nix b/modules/programs/bash.nix index 3d4496f7..90ab5dd7 100644 --- a/modules/programs/bash.nix +++ b/modules/programs/bash.nix @@ -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}