2022-06-26 17:41:46 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, roxctl }:
|
2022-05-09 15:29:49 +00:00
|
|
|
|
|
|
|
buildGoModule rec {
|
|
|
|
pname = "roxctl";
|
2022-11-10 10:12:48 +00:00
|
|
|
version = "3.72.2";
|
2022-05-09 15:29:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stackrox";
|
|
|
|
repo = "stackrox";
|
|
|
|
rev = version;
|
2022-11-10 10:12:48 +00:00
|
|
|
sha256 = "sha256-qw45Ifp8JcJyKaKL1St0HAQGS7JiUestiPGyZcV3gx8=";
|
2022-05-09 15:29:49 +00:00
|
|
|
};
|
|
|
|
|
2022-09-24 19:58:02 +00:00
|
|
|
vendorSha256 = "sha256-FmpnRgU3w2zthgUJuAG5AqLl2UxMb0yywN5Sk9WoWBI=";
|
2022-05-09 15:29:49 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
|
|
|
subPackages = [ "roxctl" ];
|
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/stackrox/rox/pkg/version/internal.MainVersion=${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
installShellCompletion --cmd roxctl \
|
|
|
|
--bash <($out/bin/roxctl completion bash) \
|
|
|
|
--fish <($out/bin/roxctl completion fish) \
|
|
|
|
--zsh <($out/bin/roxctl completion zsh)
|
|
|
|
'';
|
|
|
|
|
2022-06-26 17:41:46 +00:00
|
|
|
passthru.tests.version = testers.testVersion {
|
2022-05-09 15:29:49 +00:00
|
|
|
package = roxctl;
|
|
|
|
command = "roxctl version";
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Command-line client of the StackRox Kubernetes Security Platform";
|
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = "https://www.stackrox.io";
|
|
|
|
maintainers = with maintainers; [ stehessel ];
|
|
|
|
};
|
|
|
|
}
|