sunshine: 2025.118.151840 -> 2025.122.141614 (#376248)
[NixPkgs.git] / pkgs / by-name / ci / cilium-cli / package.nix
blobcd0054e9d4f54a829893926f1c35c028ebaa52ce
2   lib,
3   buildGoModule,
4   cilium-cli,
5   fetchFromGitHub,
6   installShellFiles,
7   testers,
8 }:
10 buildGoModule rec {
11   pname = "cilium-cli";
12   version = "0.16.22";
14   src = fetchFromGitHub {
15     owner = "cilium";
16     repo = "cilium-cli";
17     tag = "v${version}";
18     hash = "sha256-P4S+4N9f/m28lNwx7xzYcq99nvXelSvzX01QXDhfGM4=";
19   };
21   nativeBuildInputs = [ installShellFiles ];
23   vendorHash = null;
25   subPackages = [ "cmd/cilium" ];
27   ldflags = [
28     "-s"
29     "-w"
30     "-X=github.com/cilium/cilium/cilium-cli/defaults.CLIVersion=${version}"
31   ];
33   # Required to workaround install check error:
34   # 2022/06/25 10:36:22 Unable to start gops: mkdir /homeless-shelter: permission denied
35   HOME = "$TMPDIR";
37   postInstall = ''
38     installShellCompletion --cmd cilium \
39       --bash <($out/bin/cilium completion bash) \
40       --fish <($out/bin/cilium completion fish) \
41       --zsh <($out/bin/cilium completion zsh)
42   '';
44   passthru.tests.version = testers.testVersion {
45     package = cilium-cli;
46     command = "cilium version --client";
47     version = "${version}";
48   };
50   meta = {
51     description = "CLI to install, manage & troubleshoot Kubernetes clusters running Cilium";
52     homepage = "https://www.cilium.io/";
53     changelog = "https://github.com/cilium/cilium-cli/releases/tag/v${version}";
54     license = lib.licenses.asl20;
55     maintainers = with lib.maintainers; [
56       bryanasdev000
57       humancalico
58       qjoly
59     ];
60     mainProgram = "cilium";
61   };