diff --git a/nixos/modules/programs/zsh/zsh.nix b/nixos/modules/programs/zsh/zsh.nix index dc6c958ca88b..e5c5b08f8d4d 100644 --- a/nixos/modules/programs/zsh/zsh.nix +++ b/nixos/modules/programs/zsh/zsh.nix @@ -283,21 +283,8 @@ in # see https://github.com/NixOS/nixpkgs/issues/132732 environment.etc.zinputrc.text = builtins.readFile ./zinputrc; - 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.systemPackages = [ pkgs.zsh ] + ++ optional cfg.enableCompletion pkgs.nix-zsh-completions; environment.pathsToLink = optional cfg.enableCompletion "/share/zsh"; diff --git a/pkgs/shells/zsh/nix-zsh-completions/default.nix b/pkgs/shells/zsh/nix-zsh-completions/default.nix index f60bb966003f..472cc47459cf 100644 --- a/pkgs/shells/zsh/nix-zsh-completions/default.nix +++ b/pkgs/shells/zsh/nix-zsh-completions/default.nix @@ -20,6 +20,7 @@ stdenv.mkDerivation rec { meta = with lib; { homepage = "https://github.com/spwhitt/nix-zsh-completions"; description = "ZSH completions for Nix, NixOS, and NixOps"; + priority = 6; # prevent collisions with nix 2.4's built-in completions license = licenses.bsd3; platforms = platforms.all; maintainers = with maintainers; [ spwhitt olejorgenb hedning ma27 ];