11 src = fetchFromGitHub {
12 owner = "chainguard-dev";
15 hash = "sha256-PGRbJ7znsjvh/ATBF8k+pMnRO8wvGY0PAVswVmFaBUc=";
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
27 vendorHash = "sha256-aqxXCqhvCGQKI+4FDjbqPNeFvELZviQ7Inwxl65sowk=";
29 nativeBuildInputs = [ installShellFiles ];
34 "-X sigs.k8s.io/release-utils/version.gitVersion=v${version}"
35 "-X sigs.k8s.io/release-utils/version.gitTreeState=clean"
38 # ldflags based on metadata from git and source
40 ldflags+=" -X sigs.k8s.io/release-utils/version.gitCommit=$(cat COMMIT)"
41 ldflags+=" -X sigs.k8s.io/release-utils/version.buildDate=$(cat SOURCE_DATE_EPOCH)"
45 # fails to run on read-only filesystem
46 "-skip=(TestPublish|TestBuild|TestTarFS)"
50 installShellCompletion --cmd apko \
51 --bash <($out/bin/apko completion bash) \
52 --fish <($out/bin/apko completion fish) \
53 --zsh <($out/bin/apko completion zsh)
56 doInstallCheck = true;
57 installCheckPhase = ''
58 runHook preInstallCheck
61 $out/bin/apko version 2>&1 | grep "v${version}"
63 runHook postInstallCheck
67 homepage = "https://apko.dev/";
68 changelog = "https://github.com/chainguard-dev/apko/blob/main/NEWS.md";
69 description = "Build OCI images using APK directly without Dockerfile";
71 license = licenses.asl20;
72 maintainers = with maintainers; [ jk developer-guy ];