feat(nix): add shell completion outputs to flake (#1210)
Add fish, bash, and zsh completion packages to the Nix flake. Completions are generated at build time using `bd completion <shell>`. Usage: nix build .#fish-completions nix build .#bash-completions nix build .#zsh-completions Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
4ccdd7a2df
commit
e36e2f6679
20
flake.nix
20
flake.nix
@@ -23,9 +23,27 @@
|
||||
system:
|
||||
let
|
||||
pkgs = nixpkgs.legacyPackages.${system};
|
||||
bd = pkgs.callPackage ./default.nix { inherit pkgs self; };
|
||||
in
|
||||
{
|
||||
packages.default = pkgs.callPackage ./default.nix { inherit pkgs self; };
|
||||
packages = {
|
||||
default = bd;
|
||||
|
||||
fish-completions = pkgs.runCommand "bd-fish-completions" { } ''
|
||||
mkdir -p $out/share/fish/vendor_completions.d
|
||||
${bd}/bin/bd completion fish > $out/share/fish/vendor_completions.d/bd.fish
|
||||
'';
|
||||
|
||||
bash-completions = pkgs.runCommand "bd-bash-completions" { } ''
|
||||
mkdir -p $out/share/bash-completion/completions
|
||||
${bd}/bin/bd completion bash > $out/share/bash-completion/completions/bd
|
||||
'';
|
||||
|
||||
zsh-completions = pkgs.runCommand "bd-zsh-completions" { } ''
|
||||
mkdir -p $out/share/zsh/site-functions
|
||||
${bd}/bin/bd completion zsh > $out/share/zsh/site-functions/_bd
|
||||
'';
|
||||
};
|
||||
|
||||
apps.default = {
|
||||
type = "app";
|
||||
|
||||
Reference in New Issue
Block a user