nixos: zsh: move NixOS-specific variables from /etc/zshrc to /etc/zshenv

We want these to be set even when /etc/zshrc loading is disabled.
This commit is contained in:
Jan Malakhovski 2019-08-24 05:36:02 +00:00
parent 20b5f89384
commit f70e3f3738

View File

@ -147,6 +147,13 @@ in
. ${config.system.build.setEnvironment}
fi
HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help"
# Tell zsh how to find installed completions
for p in ''${(z)NIX_PROFILES}; do
fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions)
done
${cfge.shellInit}
${cfg.shellInit}
@ -192,13 +199,6 @@ in
HISTSIZE=${toString cfg.histSize}
HISTFILE=${cfg.histFile}
HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help"
# Tell zsh how to find installed completions
for p in ''${(z)NIX_PROFILES}; do
fpath+=($p/share/zsh/site-functions $p/share/zsh/$ZSH_VERSION/functions $p/share/zsh/vendor-completions)
done
${optionalString cfg.enableGlobalCompInit "autoload -U compinit && compinit"}
${cfge.interactiveShellInit}