2023-04-27 15:44:56 +00:00
|
|
|
{ lib
|
|
|
|
, buildGoModule
|
|
|
|
, fetchFromGitHub
|
2024-07-21 19:33:56 +00:00
|
|
|
, installShellFiles
|
|
|
|
, stdenv
|
2023-04-27 15:44:56 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "zarf";
|
2024-10-06 09:28:47 +00:00
|
|
|
version = "0.41.0";
|
2023-04-27 15:44:56 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "defenseunicorns";
|
|
|
|
repo = "zarf";
|
|
|
|
rev = "v${version}";
|
2024-10-06 09:28:47 +00:00
|
|
|
hash = "sha256-rY9xWqJ+2Yfs6VRHTF89LmuEruAavDI7MgBm4UFEuBs=";
|
2023-04-27 15:44:56 +00:00
|
|
|
};
|
|
|
|
|
2024-10-06 09:28:47 +00:00
|
|
|
vendorHash = "sha256-Cz+w0tOEamCxf61hvQ03X/kXPY+qrmdBN8s26lr/wZ8=";
|
2023-04-27 15:44:56 +00:00
|
|
|
proxyVendor = true;
|
|
|
|
|
2024-07-21 19:33:56 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2023-04-27 15:44:56 +00:00
|
|
|
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" ];
|
|
|
|
|
2024-07-21 19:33:56 +00:00
|
|
|
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)
|
|
|
|
'';
|
|
|
|
|
2023-04-27 15:44:56 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "DevSecOps for Air Gap & Limited-Connection Systems. https://zarf.dev";
|
2024-03-19 02:14:51 +00:00
|
|
|
mainProgram = "zarf";
|
2023-04-27 15:44:56 +00:00
|
|
|
homepage = "https://github.com/defenseunicorns/zarf.git";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ ragingpastry ];
|
|
|
|
};
|
|
|
|
}
|