Files
nixpkgs/pkgs/by-name/ky/kyverno/package.nix
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

62 lines
1.7 KiB
Nix

{
lib,
stdenv,
buildGoModule,
fetchFromGitHub,
installShellFiles,
testers,
kyverno,
}:
buildGoModule rec {
pname = "kyverno";
version = "1.15.2";
src = fetchFromGitHub {
owner = "kyverno";
repo = "kyverno";
rev = "v${version}";
hash = "sha256-Mv01ILbWFLypXGl0zCUVa3kdSZGBQH8fAP3txyUArsE=";
};
ldflags = [
"-s"
"-w"
"-X github.com/kyverno/kyverno/pkg/version.BuildVersion=v${version}"
"-X github.com/kyverno/kyverno/pkg/version.BuildHash=${version}"
"-X github.com/kyverno/kyverno/pkg/version.BuildTime=1970-01-01_00:00:00"
];
vendorHash = "sha256-2qpZEHbBqGZsIizswJYmdJCjgIBhQsnYyHHIS4ZqZYQ=";
subPackages = [ "cmd/cli/kubectl-kyverno" ];
nativeBuildInputs = [ installShellFiles ];
postInstall = ''
# we have no integration between krew and kubectl
# so better rename binary to kyverno and use as a standalone
mv $out/bin/kubectl-kyverno $out/bin/kyverno
''
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
installShellCompletion --cmd kyverno \
--bash <($out/bin/kyverno completion bash) \
--zsh <($out/bin/kyverno completion zsh) \
--fish <($out/bin/kyverno completion fish)
'';
passthru.tests.version = testers.testVersion {
package = kyverno;
command = "kyverno version";
version = "v${version}"; # needed because testVersion uses grep -Fw
};
meta = {
description = "Kubernetes Native Policy Management";
mainProgram = "kyverno";
homepage = "https://kyverno.io/";
changelog = "https://github.com/kyverno/kyverno/releases/tag/v${version}";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ bryanasdev000 ];
};
}