From 1601abe66a9a2e78a3b078e41cd604910e2d763e Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Sat, 17 Sep 2022 16:41:38 +0200 Subject: [PATCH] pinniped: make binary smaller and enable shell completions --- .../networking/cluster/pinniped/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/cluster/pinniped/default.nix b/pkgs/applications/networking/cluster/pinniped/default.nix index 9ee8109a94e3..61bb2000e136 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/";