forked from DGNum/colmena
default.nix: Fix shell auto-complete generation
This commit is contained in:
parent
ac67d87be5
commit
8a95ee87b6
1 changed files with 3 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
||||||
pkgs ? import ./pkgs.nix,
|
pkgs ? import ./pkgs.nix,
|
||||||
}: let
|
}: let
|
||||||
lib = pkgs.lib;
|
lib = pkgs.lib;
|
||||||
|
stdenv = pkgs.stdenv;
|
||||||
rustPlatform = pkgs.rustPlatform;
|
rustPlatform = pkgs.rustPlatform;
|
||||||
in rustPlatform.buildRustPackage {
|
in rustPlatform.buildRustPackage {
|
||||||
name = "colmena-dev";
|
name = "colmena-dev";
|
||||||
|
@ -16,14 +17,12 @@ in rustPlatform.buildRustPackage {
|
||||||
};
|
};
|
||||||
cargoSha256 = "10h8bsy8hh36mvdgpnbw4vxnzkxyfw2vb4r1pn7fxfn0nklgakq7";
|
cargoSha256 = "10h8bsy8hh36mvdgpnbw4vxnzkxyfw2vb4r1pn7fxfn0nklgakq7";
|
||||||
|
|
||||||
postBuild = ''
|
postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
|
||||||
mkdir completions
|
mkdir completions
|
||||||
for shell in bash fish zsh; do
|
for shell in bash fish zsh; do
|
||||||
cargo run --frozen -- gen-completions $shell > completions/$shell
|
$out/bin/colmena gen-completions $shell > completions/$shell
|
||||||
done
|
done
|
||||||
'';
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
|
mkdir -p "$out/share/"{bash-completion/completions,fish/vendor_completions.d,zsh/site-functions}
|
||||||
cp completions/bash $out/share/bash-completion/completions/colmena
|
cp completions/bash $out/share/bash-completion/completions/colmena
|
||||||
cp completions/fish $out/share/fish/vendor_completions.d/colmena.fish
|
cp completions/fish $out/share/fish/vendor_completions.d/colmena.fish
|
||||||
|
|
Loading…
Reference in a new issue