nixpkgs/pkgs/applications/networking/cluster/roxctl/default.nix
2024-11-03 23:34:07 +00:00

46 lines
1.1 KiB
Nix

{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, roxctl }:
buildGoModule rec {
pname = "roxctl";
version = "4.5.4";
src = fetchFromGitHub {
owner = "stackrox";
repo = "stackrox";
rev = version;
sha256 = "sha256-Da3KFGdhDSvdcMBbYmhgft7Sj+PPgUMsEoXAtx9Mhm8=";
};
vendorHash = "sha256-qDSi1Jk6erSCwPiLubdVlqOT6PQygMQghS8leieJ78s=";
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)
'';
passthru.tests.version = testers.testVersion {
package = roxctl;
command = "roxctl version";
};
meta = with lib; {
description = "Command-line client of the StackRox Kubernetes Security Platform";
mainProgram = "roxctl";
license = licenses.asl20;
homepage = "https://www.stackrox.io";
maintainers = with maintainers; [ stehessel ];
};
}