Skip to content

Commit

Permalink
zsh: fix HISTSIZE and HISTFILE configuration
Browse files Browse the repository at this point in the history
HISTSIZE and HISTFILE have to be set in ~/.zshrc and before
sourcing oh-my-zsh since otherwise it will be overridden.
Fixes nix-community#177.
  • Loading branch information
uvNikita committed Jan 12, 2018
1 parent d6ab6ee commit 1bc829e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions modules/programs/zsh.nix
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,6 @@ in
++ optional cfg.enableCompletion nix-zsh-completions
++ optional cfg.oh-my-zsh.enable oh-my-zsh;

programs.zsh.sessionVariables = {
HISTSIZE = cfg.history.size;
HISTFILE = "$HOME/" + cfg.history.path;
};

home.file."${relToDotDir ".zshenv"}".text = ''
typeset -U fpath
${optionalString (config.home.sessionVariableSetter != "pam") ''
Expand Down Expand Up @@ -289,6 +284,11 @@ in
source "$HOME/${pluginsDir}/${plugin.name}/${plugin.file}"
'') cfg.plugins)}
# HISTSIZE, HISTFILE have to be set in .zshrc and after oh-my-zsh sourcing
# see https://github.com/rycee/home-manager/issues/177
HISTSIZE="${toString cfg.history.size}"
HISTFILE="$HOME/${cfg.history.path}"
${cfg.initExtra}
${aliasesStr}
Expand Down

0 comments on commit 1bc829e

Please sign in to comment.