nixpkgs/pkgs/shells/zsh/nix-zsh-completions/default.nix
Michal Sojka c35e1f6c26 nix-zsh-completions: remove broken _nix completion function
That completion function works only with nix 2.3 (and older). The
newer versions use ANSI escape sequences in the --help output, and
this seems to confuse the function.

Nix 2.4+ has zsh completion built in so removing it from
nix-zsh-completions should not harm most users.
2022-11-25 00:34:57 +01:00

41 lines
1.2 KiB
Nix

{ lib, stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
pname = "nix-zsh-completions";
version = "0.4.4";
src = fetchFromGitHub {
owner = "spwhitt";
repo = "nix-zsh-completions";
rev = version;
sha256 = "1n9whlys95k4wc57cnz3n07p7zpkv796qkmn68a50ygkx6h3afqf";
};
# https://github.com/spwhitt/nix-zsh-completions/issues/42
#
# _nix completion is broken. Remove it; _nix provided by the nix
# package will be used instead. It is not sufficient to set low
# meta.priority below if nix is installed in the system profile and
# nix-zsh-completions in an user profile. In that case, the broken
# version takes precedence over the good one.
postPatch = ''
rm _nix
'';
strictDeps = true;
installPhase = ''
mkdir -p $out/share/zsh/{site-functions,plugins/nix}
cp _* $out/share/zsh/site-functions
cp *.zsh $out/share/zsh/plugins/nix
'';
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 ];
};
}