about summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/cilium/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/networking/cluster/cilium/default.nix')
-rw-r--r--pkgs/applications/networking/cluster/cilium/default.nix32
1 files changed, 28 insertions, 4 deletions
diff --git a/pkgs/applications/networking/cluster/cilium/default.nix b/pkgs/applications/networking/cluster/cilium/default.nix
index 648b0048e3e29..74bba4b13c2fb 100644
--- a/pkgs/applications/networking/cluster/cilium/default.nix
+++ b/pkgs/applications/networking/cluster/cilium/default.nix
@@ -1,23 +1,47 @@
-{ lib, buildGoModule, fetchFromGitHub }:
+{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
 
 buildGoModule rec {
   pname = "cilium-cli";
-  version = "0.11.7";
+  version = "0.11.10";
 
   src = fetchFromGitHub {
     owner = "cilium";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-4+4E7v/b74DDekqymH8PR7/GfH3GGzSQFQk24VJisQ0=";
+    sha256 = "sha256-BkcnChxUceWGG5hBOHvzZokgcw8T/vvNwIEtHkLfUJA=";
   };
 
   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 ];
+    maintainers = with maintainers; [ humancalico bryanasdev000 ];
     mainProgram = "cilium";
   };
 }