1
0
Fork 0
mirror of https://github.com/nix-community/home-manager synced 2024-11-27 13:39:46 +01:00

zsh: add system packages' completion path to fpath

This commit is contained in:
Nikita Uvarov 2018-01-29 11:30:26 +01:00
parent fa6f697dbb
commit 2304c145f3
No known key found for this signature in database
GPG key ID: F7A5FB3A7C10EF96

View file

@ -153,7 +153,13 @@ in
enableCompletion = mkOption { enableCompletion = mkOption {
default = true; default = true;
description = "Enable zsh completion."; description = ''
Enable zsh completion. Don't forget to add
<programlisting>
environment.pathsToLink = [ "/share/zsh" ];
</programlisting>
to your system configuration to get completion for system packages (e.g. systemd).
'';
type = types.bool; type = types.bool;
}; };
@ -278,8 +284,10 @@ in
home.file."${relToDotDir ".zshrc"}".text = '' home.file."${relToDotDir ".zshrc"}".text = ''
typeset -U path cdpath fpath manpath typeset -U path cdpath fpath manpath
fpath+="$HOME/.nix-profile/share/zsh/site-functions"
fpath+="$HOME/.nix-profile/share/zsh/$ZSH_VERSION/functions" for profile in ''${(z)NIX_PROFILES}; do
fpath+=($profile/share/zsh/site-functions $profile/share/zsh/$ZSH_VERSION/functions $profile/share/zsh/vendor-completions)
done
HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help" HELPDIR="${pkgs.zsh}/share/zsh/$ZSH_VERSION/help"