rekor-cli, rekor-server: install shell completions

This commit is contained in:
Thomas Gerbet
2021-12-29 08:57:56 +01:00
parent 9c49aab2d2
commit 24612ec4d4
+10 -1
View File
@@ -1,4 +1,4 @@
{ lib, buildGoModule, fetchFromGitHub }:
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
let
generic = { pname, packageToBuild, description }:
@@ -15,10 +15,19 @@ let
vendorSha256 = "sha256-XCCO4Vamzj5pJFmu1A8mpTLlVAtocrn20myYJVWtBrY=";
nativeBuildInputs = [ installShellFiles ];
subPackages = [ packageToBuild ];
ldflags = [ "-s" "-w" "-X github.com/sigstore/rekor/${packageToBuild}/app.GitVersion=v${version}" ];
postInstall = ''
installShellCompletion --cmd ${pname} \
--bash <($out/bin/${pname} completion bash) \
--fish <($out/bin/${pname} completion fish) \
--zsh <($out/bin/${pname} completion zsh)
'';
meta = with lib; {
inherit description;
homepage = "https://github.com/sigstore/rekor";