mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 15:13:46 +00:00
45 lines
1.1 KiB
Nix
45 lines
1.1 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, installShellFiles, testers, roxctl }:
|
|
|
|
buildGoModule rec {
|
|
pname = "roxctl";
|
|
version = "3.72.2";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "stackrox";
|
|
repo = "stackrox";
|
|
rev = version;
|
|
sha256 = "sha256-qw45Ifp8JcJyKaKL1St0HAQGS7JiUestiPGyZcV3gx8=";
|
|
};
|
|
|
|
vendorSha256 = "sha256-FmpnRgU3w2zthgUJuAG5AqLl2UxMb0yywN5Sk9WoWBI=";
|
|
|
|
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";
|
|
license = licenses.asl20;
|
|
homepage = "https://www.stackrox.io";
|
|
maintainers = with maintainers; [ stehessel ];
|
|
};
|
|
}
|