mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-15 22:36:23 +01:00
49 lines
1.2 KiB
Nix
49 lines
1.2 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
buildGoModule rec {
|
|
pname = "kubernetes-polaris";
|
|
version = "9.3.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "FairwindsOps";
|
|
repo = "polaris";
|
|
rev = version;
|
|
sha256 = "sha256-qJAhxwVM/tYdCWLL1snUYjXGfgdcHkBFrI9xBg1/EXU=";
|
|
};
|
|
|
|
vendorHash = "sha256-6sxzRI22xiZOQds20iU5OsU+JqcNB2wOUrOZrOH1Sa4=";
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X main.Version=${version}"
|
|
"-X main.Commit=${version}"
|
|
];
|
|
|
|
postInstall = ''
|
|
installShellCompletion --cmd polaris \
|
|
--bash <($out/bin/polaris completion bash) \
|
|
--fish <($out/bin/polaris completion fish) \
|
|
--zsh <($out/bin/polaris completion zsh)
|
|
'';
|
|
|
|
doInstallCheck = true;
|
|
installCheckPhase = ''
|
|
runHook preInstallCheck
|
|
|
|
$out/bin/polaris help
|
|
$out/bin/polaris version | grep 'Polaris version:${version}'
|
|
|
|
runHook postInstallCheck
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Validate and remediate Kubernetes resources to ensure configuration best practices are followed";
|
|
mainProgram = "polaris";
|
|
homepage = "https://www.fairwinds.com/polaris";
|
|
license = with licenses; [ asl20 ];
|
|
maintainers = with maintainers; [ longer ];
|
|
};
|
|
}
|