NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.04k stars 13.38k forks source link

[Feature] Shell completions for zig compiler #281900

Open luisnquin opened 7 months ago

luisnquin commented 7 months ago

Issue description

The current zig package doesn't provide shell completions via the installShellCompletion utility. The compiler itself doesn't have a completions command, but the Zig organization has the repository github:ziglang/shell-completions to at least have them in bash and zsh.

luisnquin commented 7 months ago

I managed to implement the zsh completions via home manager with:

{
  programs.zsh.plugins = [
    {
      name = "zig-zsh-completions-plugin";
      file = "zig-shell-completions.plugin.zsh";
      src = pkgs.fetchFromGitHub {
        owner = "ziglang";
        repo = "shell-completions";
        rev = "31d3ad12890371bf467ef7143f5c2f31cfa7b7c1";
        sha256 = "1fzl1x56b4m11wajk1az4p24312z7wlj2cqa3b519v30yz9clgr0";
      };
    }
  ];
}

But as I said, this might be achieved in the zig package.

msanft commented 7 months ago

Hey! There already is the package zig-shell-completions, which seems to be just what you want.

The zig package should really only provide the toolchain, as one should be able to get only the toolchain, without any additional bloat that might not be required.