diff --git a/pkgs/tools/misc/zitadel-tools/default.nix b/pkgs/tools/misc/zitadel-tools/default.nix index 4dc681a6d090..51defb87e932 100644 --- a/pkgs/tools/misc/zitadel-tools/default.nix +++ b/pkgs/tools/misc/zitadel-tools/default.nix @@ -1,6 +1,7 @@ { lib , buildGoModule , fetchFromGitHub +, installShellFiles }: buildGoModule rec { @@ -14,6 +15,8 @@ buildGoModule rec { hash = "sha256-r9GEHpfDlpK98/dnsxjhUgWKn6vHQla8Z+jQUVrHGyo="; }; + nativeBuildInputs = [ installShellFiles ]; + vendorHash = "sha256-y2PYj0XRSgfiaYpeqAh4VR/+NKUPKd1c0w9pPCWsUrY="; ldflags = [ @@ -21,6 +24,14 @@ buildGoModule rec { "-X main.version=${version}" ]; + postInstall = '' + local INSTALL="$out/bin/zitadel-tools" + installShellCompletion --cmd zitadel-tools \ + --bash <($out/bin/zitadel-tools completion bash) \ + --fish <($out/bin/zitadel-tools completion fish) \ + --zsh <($out/bin/zitadel-tools completion zsh) + ''; + meta = with lib; { description = "Helper tools for zitadel"; homepage = "https://github.com/zitadel/zitadel-tools";