From 738d3dda54b39f62be82886a17f6fbcb311c9ab4 Mon Sep 17 00:00:00 2001 From: Michael Faille Date: Sun, 9 Aug 2020 18:59:39 -0400 Subject: [PATCH] tanka: add bash completion --- pkgs/applications/networking/cluster/tanka/default.nix | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/cluster/tanka/default.nix b/pkgs/applications/networking/cluster/tanka/default.nix index b4900a2018d..fcf1fc054e0 100644 --- a/pkgs/applications/networking/cluster/tanka/default.nix +++ b/pkgs/applications/networking/cluster/tanka/default.nix @@ -1,4 +1,4 @@ -{ buildGoModule, fetchFromGitHub, lib }: +{ buildGoModule, fetchFromGitHub, lib, installShellFiles }: buildGoModule rec { pname = "tanka"; @@ -15,6 +15,13 @@ buildGoModule rec { buildFlagsArray = [ "-ldflags=-s -w -X main.Version=${version}" ]; + nativeBuildInputs = [ installShellFiles ]; + + postInstall = '' + echo "complete -C $out/bin/tk tk" > tk.bash + installShellCompletion tk.bash + ''; + meta = with lib; { description = "Flexible, reusable and concise configuration for Kubernetes"; homepage = "https://github.com/grafana/tanka/";