From 5177c0fd3d3908674950c400b5ee37ab03251b1f Mon Sep 17 00:00:00 2001 From: Aaron Jheng Date: Sat, 22 Oct 2022 07:44:49 +0000 Subject: [PATCH] ctlptl: install shell completions --- pkgs/development/tools/ctlptl/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/ctlptl/default.nix b/pkgs/development/tools/ctlptl/default.nix index 569ba12d4923..fff37d7f2b87 100644 --- a/pkgs/development/tools/ctlptl/default.nix +++ b/pkgs/development/tools/ctlptl/default.nix @@ -1,4 +1,4 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: buildGoModule rec { pname = "ctlptl"; @@ -13,12 +13,21 @@ buildGoModule rec { vendorSha256 = "sha256-M9B/rfMBjYJb9szmYPVZqURlcv62qHOLJ3ka0v++z0s="; + nativeBuildInputs = [ installShellFiles ]; + ldflags = [ "-s" "-w" "-X main.version=${version}" ]; + postInstall = '' + installShellCompletion --cmd ctlptl \ + --bash <($out/bin/ctlptl completion bash) \ + --fish <($out/bin/ctlptl completion fish) \ + --zsh <($out/bin/ctlptl completion zsh) + ''; + meta = with lib; { description = "CLI for declaratively setting up local Kubernetes clusters"; homepage = "https://github.com/tilt-dev/ctlptl";