From dbcb3dd1aecf318689118a4a95fd1f43d76e2282 Mon Sep 17 00:00:00 2001 From: Nikita Uvarov Date: Fri, 12 Jan 2018 11:24:08 +0100 Subject: [PATCH] zsh: fix HISTSIZE and HISTFILE configuration HISTSIZE and HISTFILE should be set in ~/.zshrc and before sourcing oh-my-zsh since otherwise it will be overridden. Fixes #177. --- modules/programs/zsh.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/programs/zsh.nix b/modules/programs/zsh.nix index 4c97a921d..954ecb6bc 100644 --- a/modules/programs/zsh.nix +++ b/modules/programs/zsh.nix @@ -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") '' @@ -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}