diff --git a/modules/programs/zsh/default.nix b/modules/programs/zsh/default.nix index bbf8ad9e0..58a3155fc 100644 --- a/modules/programs/zsh/default.nix +++ b/modules/programs/zsh/default.nix @@ -135,6 +135,11 @@ in . ${config.system.build.setEnvironment} fi + # 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 $fpath) + done + ${cfg.shellInit} # Read system-wide modifications. @@ -182,11 +187,6 @@ in ${config.environment.interactiveShellInit} ${cfg.interactiveShellInit} - # 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 - ${cfg.promptInit} ${optionalString cfg.enableGlobalCompInit "autoload -U compinit && compinit"}