From cc563d84328bd3e77802a2ea02f2f2e6c1394253 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Thu, 18 Mar 2021 18:58:03 +1000 Subject: [PATCH] kapp: install completion --- pkgs/tools/networking/kapp/default.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/networking/kapp/default.nix b/pkgs/tools/networking/kapp/default.nix index dfb641348714..2ff2fd8daec1 100644 --- a/pkgs/tools/networking/kapp/default.nix +++ b/pkgs/tools/networking/kapp/default.nix @@ -1,4 +1,4 @@ -{ lib, buildGoModule, fetchFromGitHub }: +{ lib, buildGoModule, fetchFromGitHub, installShellFiles }: buildGoModule rec { pname = "kapp"; version = "0.36.0"; @@ -14,6 +14,15 @@ buildGoModule rec { subPackages = [ "cmd/kapp" ]; + nativeBuildInputs = [ installShellFiles ]; + + postInstall = '' + for shell in bash fish zsh; do + $out/bin/kapp completion $shell > kapp.$shell + installShellCompletion kapp.$shell + done + ''; + meta = with lib; { description = "CLI tool that encourages Kubernetes users to manage bulk resources with an application abstraction for grouping"; homepage = "https://get-kapp.io";