Merge pull request #146030 from antifuchs/nix-zsh-completions-with-fewer-hacks

This commit is contained in:
Sandro 2021-11-14 23:44:45 +01:00 committed by GitHub
commit f40b4789e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 15 deletions

View file

@ -283,21 +283,8 @@ in
# see https://github.com/NixOS/nixpkgs/issues/132732 # see https://github.com/NixOS/nixpkgs/issues/132732
environment.etc.zinputrc.text = builtins.readFile ./zinputrc; environment.etc.zinputrc.text = builtins.readFile ./zinputrc;
environment.systemPackages = environment.systemPackages = [ pkgs.zsh ]
let ++ optional cfg.enableCompletion pkgs.nix-zsh-completions;
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"; environment.pathsToLink = optional cfg.enableCompletion "/share/zsh";

View file

@ -20,6 +20,7 @@ stdenv.mkDerivation rec {
meta = with lib; { meta = with lib; {
homepage = "https://github.com/spwhitt/nix-zsh-completions"; homepage = "https://github.com/spwhitt/nix-zsh-completions";
description = "ZSH completions for Nix, NixOS, and NixOps"; description = "ZSH completions for Nix, NixOS, and NixOps";
priority = 6; # prevent collisions with nix 2.4's built-in completions
license = licenses.bsd3; license = licenses.bsd3;
platforms = platforms.all; platforms = platforms.all;
maintainers = with maintainers; [ spwhitt olejorgenb hedning ma27 ]; maintainers = with maintainers; [ spwhitt olejorgenb hedning ma27 ];