diff --git a/default.nix b/default.nix index 26c4434..0e423cf 100644 --- a/default.nix +++ b/default.nix @@ -2,6 +2,7 @@ pkgs ? import ./pkgs.nix, }: let lib = pkgs.lib; + stdenv = pkgs.stdenv; rustPlatform = pkgs.rustPlatform; in rustPlatform.buildRustPackage { name = "colmena-dev"; @@ -16,14 +17,12 @@ in rustPlatform.buildRustPackage { }; cargoSha256 = "10h8bsy8hh36mvdgpnbw4vxnzkxyfw2vb4r1pn7fxfn0nklgakq7"; - postBuild = '' + postInstall = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) '' mkdir completions for shell in bash fish zsh; do - cargo run --frozen -- gen-completions $shell > completions/$shell + $out/bin/colmena gen-completions $shell > completions/$shell done - ''; - postInstall = '' 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/fish $out/share/fish/vendor_completions.d/colmena.fish