nixpkgs/pkgs/by-name/za/zarf/package.nix
Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d5c88a98d674f637d092807cfc12253.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e4587d75882aebc21a04bee960418f8ce9
2025-04-08 02:57:25 -04:00

61 lines
1.5 KiB
Nix

{
lib,
buildGoModule,
fetchFromGitHub,
installShellFiles,
stdenv,
}:
buildGoModule rec {
pname = "zarf";
version = "0.41.0";
src = fetchFromGitHub {
owner = "defenseunicorns";
repo = "zarf";
rev = "v${version}";
hash = "sha256-rY9xWqJ+2Yfs6VRHTF89LmuEruAavDI7MgBm4UFEuBs=";
};
vendorHash = "sha256-Cz+w0tOEamCxf61hvQ03X/kXPY+qrmdBN8s26lr/wZ8=";
proxyVendor = true;
nativeBuildInputs = [ installShellFiles ];
preBuild = ''
mkdir -p build/ui
touch build/ui/index.html
'';
doCheck = false;
ldflags = [
"-s"
"-w"
"-X"
"github.com/defenseunicorns/zarf/src/config.CLIVersion=${src.rev}"
"-X"
"k8s.io/component-base/version.gitVersion=v0.0.0+zarf${src.rev}"
"-X"
"k8s.io/component-base/version.gitCommit=${src.rev}"
"-X"
"k8s.io/component-base/version.buildDate=1970-01-01T00:00:00Z"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
export K9S_LOGS_DIR=$(mktemp -d)
installShellCompletion --cmd zarf \
--bash <($out/bin/zarf completion --no-log-file bash) \
--fish <($out/bin/zarf completion --no-log-file fish) \
--zsh <($out/bin/zarf completion --no-log-file zsh)
'';
meta = with lib; {
description = "DevSecOps for Air Gap & Limited-Connection Systems. https://zarf.dev";
mainProgram = "zarf";
homepage = "https://github.com/defenseunicorns/zarf.git";
license = licenses.asl20;
maintainers = with maintainers; [ ragingpastry ];
};
}