mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-20 20:53:48 +00:00
48 lines
1.1 KiB
Nix
48 lines
1.1 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
||
|
||
buildGoModule rec {
|
||
pname = "datree";
|
||
version = "1.5.25";
|
||
|
||
src = fetchFromGitHub {
|
||
owner = "datreeio";
|
||
repo = "datree";
|
||
rev = version;
|
||
hash = "sha256-OB5o/ouA6a2/OUnhibTKYCskCFmJIuDcXLrNTNWtNEQ=";
|
||
};
|
||
|
||
vendorSha256 = "sha256-6Ve7Ui90KHsFwRs6/uyjqHgRY6U7zFWijSFcVuOXdEM=";
|
||
|
||
ldflags = [
|
||
"-extldflags '-static'"
|
||
"-s"
|
||
"-w"
|
||
"-X github.com/datreeio/datree/cmd.CliVersion=${version}"
|
||
];
|
||
|
||
nativeBuildInputs = [ installShellFiles ];
|
||
|
||
doInstallCheck = true;
|
||
installCheckPhase = ''
|
||
$out/bin/datree version | grep ${version} > /dev/null
|
||
'';
|
||
|
||
postInstall = ''
|
||
for shell in bash fish zsh; do
|
||
$out/bin/datree completion $shell > datree.$shell
|
||
installShellCompletion datree.$shell
|
||
done
|
||
'';
|
||
|
||
doCheck = true;
|
||
|
||
meta = with lib; {
|
||
description =
|
||
"CLI tool to ensure K8s manifests and Helm charts follow best practices as well as your organization’s policies";
|
||
homepage = "https://datree.io/";
|
||
license = [ licenses.asl20 ];
|
||
maintainers = [ maintainers.jceb ];
|
||
mainProgram = "datree";
|
||
};
|
||
}
|