2021-12-29 08:57:56 +01:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
2021-03-27 17:00:20 +01:00
|
|
|
|
2021-03-27 17:16:20 +01:00
|
|
|
let
|
2021-06-17 10:40:33 +02:00
|
|
|
generic = { pname, packageToBuild, description }:
|
2021-03-27 17:16:20 +01:00
|
|
|
buildGoModule rec {
|
|
|
|
inherit pname;
|
2022-02-05 09:37:31 +01:00
|
|
|
version = "0.5.0";
|
2021-03-27 17:00:20 +01:00
|
|
|
|
2021-03-27 17:16:20 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sigstore";
|
|
|
|
repo = "rekor";
|
|
|
|
rev = "v${version}";
|
2022-02-05 09:37:31 +01:00
|
|
|
sha256 = "sha256-y8klkb0hyITxLhcNWF7RYRVwF8rclDKzQF/MJs6y//Y=";
|
2021-03-27 17:16:20 +01:00
|
|
|
};
|
2021-03-27 17:00:20 +01:00
|
|
|
|
2022-02-05 09:37:31 +01:00
|
|
|
vendorSha256 = "sha256-0PPdnE3ND/YNIk50XkgBROpe5OhFiFre5Lwsml02DQU=";
|
2021-03-27 17:00:20 +01:00
|
|
|
|
2021-12-29 08:57:56 +01:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2021-06-17 10:40:33 +02:00
|
|
|
subPackages = [ packageToBuild ];
|
|
|
|
|
2022-02-05 09:37:31 +01:00
|
|
|
ldflags = [ "-s" "-w" "-X github.com/sigstore/rekor/pkg/api.GitVersion=v${version}" ];
|
2021-03-27 17:00:20 +01:00
|
|
|
|
2021-12-29 08:57:56 +01:00
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd ${pname} \
|
|
|
|
--bash <($out/bin/${pname} completion bash) \
|
|
|
|
--fish <($out/bin/${pname} completion fish) \
|
|
|
|
--zsh <($out/bin/${pname} completion zsh)
|
|
|
|
'';
|
|
|
|
|
2021-03-27 17:16:20 +01:00
|
|
|
meta = with lib; {
|
|
|
|
inherit description;
|
|
|
|
homepage = "https://github.com/sigstore/rekor";
|
|
|
|
changelog = "https://github.com/sigstore/rekor/releases/tag/v${version}";
|
|
|
|
license = licenses.asl20;
|
2021-07-28 12:35:21 +02:00
|
|
|
maintainers = with maintainers; [ lesuisse jk ];
|
2021-03-27 17:16:20 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
in {
|
|
|
|
rekor-cli = generic {
|
|
|
|
pname = "rekor-cli";
|
2021-06-17 10:40:33 +02:00
|
|
|
packageToBuild = "cmd/rekor-cli";
|
2021-03-27 17:00:20 +01:00
|
|
|
description = "CLI client for Sigstore, the Signature Transparency Log";
|
2021-03-27 17:16:20 +01:00
|
|
|
};
|
|
|
|
rekor-server = generic {
|
|
|
|
pname = "rekor-server";
|
2021-06-17 10:40:33 +02:00
|
|
|
packageToBuild = "cmd/rekor-server";
|
2021-03-27 17:16:20 +01:00
|
|
|
description = "Sigstore server, the Signature Transparency Log";
|
2021-03-27 17:00:20 +01:00
|
|
|
};
|
|
|
|
}
|