11 src = fetchFromGitHub {
12 owner = "kubernetes-sigs";
15 hash = "sha256-nYzBaFtOJhqO0O6MJsxTw/mxsIOa+cnU27nOFRe2/uI=";
16 # populate values that require us to use git. By doing this in postFetch we
17 # can delete .git afterwards and maintain better reproducibility of the src.
21 git rev-parse HEAD > $out/COMMIT
22 # '0000-00-00T00:00:00Z'
23 date -u -d "@$(git log -1 --pretty=%ct)" "+'%Y-%m-%dT%H:%M:%SZ'" > $out/SOURCE_DATE_EPOCH
24 find "$out" -name .git -print0 | xargs -0 rm -rf
28 vendorHash = "sha256-q2dK1hO3ruvts4BtQ1VGgTH3qNMzmS22CUuA52t5OvE=";
30 nativeBuildInputs = [ installShellFiles ];
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 bom \
47 --bash <($out/bin/bom completion bash) \
48 --fish <($out/bin/bom completion fish) \
49 --zsh <($out/bin/bom completion zsh)
52 doInstallCheck = true;
53 installCheckPhase = ''
54 runHook preInstallCheck
56 $out/bin/bom version 2>&1 | grep "v${version}"
57 runHook postInstallCheck
63 homepage = "https://github.com/kubernetes-sigs/bom";
64 changelog = "https://github.com/kubernetes-sigs/bom/releases/tag/v${version}";
65 description = "Utility to generate SPDX-compliant Bill of Materials manifests";
66 license = licenses.asl20;
67 maintainers = with maintainers; [ developer-guy ];