1 { lib, buildGoModule, fetchFromGitHub, installShellFiles }:
4 generic = { pname, packageToBuild, description }:
9 src = fetchFromGitHub {
13 hash = "sha256-CGRR+rOlcFTfvXRxx6x7m0qK6YE6HZGvmMx+X7zu1sQ=";
14 # populate values that require us to use git. By doing this in postFetch we
15 # can delete .git afterwards and maintain better reproducibility of the src.
19 git rev-parse HEAD > $out/COMMIT
20 # '0000-00-00T00:00:00Z'
21 date -u -d "@$(git log -1 --pretty=%ct)" "+'%Y-%m-%dT%H:%M:%SZ'" > $out/SOURCE_DATE_EPOCH
22 find "$out" -name .git -print0 | xargs -0 rm -rf
26 vendorHash = "sha256-PDf3nUvDDBg+POMpklx45VhhjlB55pUMRhQMlwq7lnI=";
28 nativeBuildInputs = [ installShellFiles ];
30 subPackages = [ packageToBuild ];
35 "-X sigs.k8s.io/release-utils/version.gitVersion=v${version}"
36 "-X sigs.k8s.io/release-utils/version.gitTreeState=clean"
39 # ldflags based on metadata from git and source
41 ldflags+=" -X sigs.k8s.io/release-utils/version.gitCommit=$(cat COMMIT)"
42 ldflags+=" -X sigs.k8s.io/release-utils/version.buildDate=$(cat SOURCE_DATE_EPOCH)"
46 installShellCompletion --cmd ${pname} \
47 --bash <($out/bin/${pname} completion bash) \
48 --fish <($out/bin/${pname} completion fish) \
49 --zsh <($out/bin/${pname} completion zsh)
54 homepage = "https://github.com/sigstore/rekor";
55 changelog = "https://github.com/sigstore/rekor/releases/tag/v${version}";
56 license = licenses.asl20;
57 maintainers = with maintainers; [ lesuisse jk developer-guy ];
63 packageToBuild = "cmd/rekor-cli";
64 description = "CLI client for Sigstore, the Signature Transparency Log";
66 rekor-server = generic {
67 pname = "rekor-server";
68 packageToBuild = "cmd/rekor-server";
69 description = "Sigstore server, the Signature Transparency Log";