zsh: include completions for nix-* commands

(cherry picked from commit 6dbf8c04097c8961bb1cb9cb319fee42eb19ab7a)
This commit is contained in:
Timothy DeHerrera 2021-07-03 13:54:00 -06:00 committed by github-actions[bot]
parent b16eb24c4d
commit 6322c5baf7

View File

@ -280,11 +280,21 @@ in
environment.etc.zinputrc.source = ./zinputrc; environment.etc.zinputrc.source = ./zinputrc;
environment.systemPackages = [ pkgs.zsh ] environment.systemPackages =
++ optional let
(cfg.enableCompletion completions =
&& !lib.versionAtLeast (lib.getVersion config.nix.package) "2.4pre") if lib.versionAtLeast (lib.getVersion config.nix.package) "2.4pre"
pkgs.nix-zsh-completions; then
pkgs.nix-zsh-completions.overrideAttrs
(_: {
postInstall = ''
rm $out/share/zsh/site-functions/_nix
'';
})
else pkgs.nix-zsh-completions;
in
[ pkgs.zsh ]
++ optional cfg.enableCompletion completions;
environment.pathsToLink = optional cfg.enableCompletion "/share/zsh"; environment.pathsToLink = optional cfg.enableCompletion "/share/zsh";