mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-25 23:23:07 +00:00
48 lines
1.3 KiB
Nix
48 lines
1.3 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
|
|
|
|
buildGoModule rec {
|
|
pname = "cilium-cli";
|
|
version = "0.12.11";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "cilium";
|
|
repo = pname;
|
|
rev = "v${version}";
|
|
sha256 = "sha256-50D3iH5KAWvX7lAPHY7cUKc4d4ww47ti2QOgdrfY1BY=";
|
|
};
|
|
|
|
vendorSha256 = null;
|
|
|
|
subPackages = [ "cmd/cilium" ];
|
|
|
|
ldflags = [
|
|
"-s" "-w"
|
|
"-X github.com/cilium/cilium-cli/internal/cli/cmd.Version=${version}"
|
|
];
|
|
|
|
# Required to workaround install check error:
|
|
# 2022/06/25 10:36:22 Unable to start gops: mkdir /homeless-shelter: permission denied
|
|
HOME = "$TMPDIR";
|
|
|
|
doInstallCheck = true;
|
|
installCheckPhase = ''
|
|
$out/bin/cilium version | grep ${version} > /dev/null
|
|
'';
|
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
postInstall = ''
|
|
installShellCompletion --cmd cilium \
|
|
--bash <($out/bin/cilium completion bash) \
|
|
--fish <($out/bin/cilium completion fish) \
|
|
--zsh <($out/bin/cilium completion zsh)
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "CLI to install, manage & troubleshoot Kubernetes clusters running Cilium";
|
|
license = licenses.asl20;
|
|
homepage = "https://www.cilium.io/";
|
|
maintainers = with maintainers; [ humancalico bryanasdev000 ];
|
|
mainProgram = "cilium";
|
|
};
|
|
}
|