about summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/pinniped/default.nix
diff options
context:
space:
mode:
authorThomas Gerbet <thomas@gerbet.me>2022-09-17 16:41:38 +0200
committerThomas Gerbet <thomas@gerbet.me>2022-09-17 16:41:38 +0200
commit1601abe66a9a2e78a3b078e41cd604910e2d763e (patch)
treef0d2a14ab7226e01d2f1a62a4b676995443cd9e5 /pkgs/applications/networking/cluster/pinniped/default.nix
parent42c82cf06e575a09b876446eba7d9ef286c0f98b (diff)
pinniped: make binary smaller and enable shell completions
Diffstat (limited to 'pkgs/applications/networking/cluster/pinniped/default.nix')
-rw-r--r--pkgs/applications/networking/cluster/pinniped/default.nix13
1 files changed, 12 insertions, 1 deletions
diff --git a/pkgs/applications/networking/cluster/pinniped/default.nix b/pkgs/applications/networking/cluster/pinniped/default.nix
index 9ee8109a94e33..61bb2000e136c 100644
--- a/pkgs/applications/networking/cluster/pinniped/default.nix
+++ b/pkgs/applications/networking/cluster/pinniped/default.nix
@@ -1,4 +1,4 @@
-{ lib, fetchFromGitHub, buildGoModule }:
+{ lib, fetchFromGitHub, buildGoModule, installShellFiles }:
 
 buildGoModule rec{
   pname = "pinniped";
@@ -15,6 +15,17 @@ buildGoModule rec{
 
   vendorSha256 = "sha256-8ohyyciL1ORYOxPu64W0jXASTv+vVZR8StutzbF9N4Y=";
 
+  ldflags = [ "-s" "-w" ];
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  postInstall = ''
+    installShellCompletion --cmd pinniped \
+      --bash <($out/bin/pinniped completion bash) \
+      --fish <($out/bin/pinniped completion fish) \
+      --zsh <($out/bin/pinniped completion zsh)
+  '';
+
   meta = with lib; {
     description = "Tool to securely log in to your Kubernetes clusters";
     homepage = "https://pinniped.dev/";