zsh: include completions for nix-* commands
(cherry picked from commit 6dbf8c04097c8961bb1cb9cb319fee42eb19ab7a)
This commit is contained in:
parent
b16eb24c4d
commit
6322c5baf7
|
@ -280,11 +280,21 @@ in
|
|||
|
||||
environment.etc.zinputrc.source = ./zinputrc;
|
||||
|
||||
environment.systemPackages = [ pkgs.zsh ]
|
||||
++ optional
|
||||
(cfg.enableCompletion
|
||||
&& !lib.versionAtLeast (lib.getVersion config.nix.package) "2.4pre")
|
||||
pkgs.nix-zsh-completions;
|
||||
environment.systemPackages =
|
||||
let
|
||||
completions =
|
||||
if lib.versionAtLeast (lib.getVersion config.nix.package) "2.4pre"
|
||||
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";
|
||||
|
||||
|
|
Loading…
Reference in New Issue