3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/tools/security/kubesec/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

55 lines
1.4 KiB
Nix
Raw Normal View History

2021-04-26 11:20:51 +01:00
{ lib
, buildGoModule
, fetchFromGitHub
2022-07-06 19:11:55 +01:00
, installShellFiles
2021-04-26 11:20:51 +01:00
}:
buildGoModule rec {
pname = "kubesec";
2022-07-06 19:11:55 +01:00
version = "2.11.5";
2021-04-26 11:20:51 +01:00
src = fetchFromGitHub {
owner = "controlplaneio";
repo = pname;
rev = "v${version}";
2022-07-06 19:11:55 +01:00
sha256 = "sha256-SxXYtIoyKe9/M3Ct1qy2QC6pYpt9GOefGsC5nUCoTEA=";
2021-04-26 11:20:51 +01:00
};
2022-07-06 19:11:55 +01:00
vendorSha256 = "sha256-pq4s/Rqu1I1nrTxy5Cn1rt5HO6z7ziKz/9LLpXLYpPc=";
2021-04-26 11:20:51 +01:00
2022-07-06 19:11:55 +01:00
nativeBuildInputs = [ installShellFiles ];
ldflags = [
"-s"
"-w"
"-X github.com/controlplaneio/kubesec/v${lib.versions.major version}/cmd.version=v${version}"
];
2021-04-26 11:20:51 +01:00
# Tests wants to download the kubernetes schema for use with kubeval
2021-04-26 11:20:51 +01:00
doCheck = false;
2022-07-06 19:11:55 +01:00
postInstall = ''
installShellCompletion --cmd kubesec \
--bash <($out/bin/kubesec completion bash) \
--fish <($out/bin/kubesec completion fish) \
--zsh <($out/bin/kubesec completion zsh)
'';
doInstallCheck = true;
installCheckPhase = ''
runHook preInstallCheck
$out/bin/kubesec --help
$out/bin/kubesec version | grep "${version}"
runHook postInstallCheck
'';
2021-04-26 11:20:51 +01:00
meta = with lib; {
description = "Security risk analysis tool for Kubernetes resources";
homepage = "https://github.com/controlplaneio/kubesec";
changelog = "https://github.com/controlplaneio/kubesec/blob/v${version}/CHANGELOG.md";
2021-04-26 11:20:51 +01:00
license = with licenses; [ asl20 ];
2022-07-06 19:11:55 +01:00
maintainers = with maintainers; [ fab jk ];
2021-04-26 11:20:51 +01:00
};
}