about summary refs log tree commit diff
path: root/pkgs/applications/networking/cluster/helm/chart-testing
diff options
context:
space:
mode:
authorlegendofmiracles <legendofmiracles@protonmail.com>2022-01-11 21:46:01 -0600
committerlegendofmiracles <legendofmiracles@protonmail.com>2022-01-11 21:46:01 -0600
commit128359aeca4ae0b07efa4912ef051a3d0e054431 (patch)
tree3640c1fe71d7c03dcdb2e70db04df390487a8ca0 /pkgs/applications/networking/cluster/helm/chart-testing
parenta2bbddbf366838a8a767d6914e1a32214499f1a4 (diff)
chart-testing: install shell completion
Diffstat (limited to 'pkgs/applications/networking/cluster/helm/chart-testing')
-rw-r--r--pkgs/applications/networking/cluster/helm/chart-testing/default.nix10
1 files changed, 9 insertions, 1 deletions
diff --git a/pkgs/applications/networking/cluster/helm/chart-testing/default.nix b/pkgs/applications/networking/cluster/helm/chart-testing/default.nix
index 484f873a91ea3..2f6dcbe01446a 100644
--- a/pkgs/applications/networking/cluster/helm/chart-testing/default.nix
+++ b/pkgs/applications/networking/cluster/helm/chart-testing/default.nix
@@ -1,4 +1,4 @@
-{ lib, buildGoModule, fetchFromGitHub }:
+{ lib, buildGoModule, fetchFromGitHub, installShellFiles }:
 
 buildGoModule rec {
   pname = "chart-testing";
@@ -26,9 +26,16 @@ buildGoModule rec {
     "-X github.com/helm/chart-testing/v3/ct/cmd.BuildDate=19700101-00:00:00"
   ];
 
+  nativeBuildInputs = [ installShellFiles ];
+
   postInstall = ''
     install -Dm644 -t $out/etc/ct etc/chart_schema.yaml
     install -Dm644 -t $out/etc/ct etc/lintconf.yaml
+
+    installShellCompletion --cmd ct \
+      --bash <($out/bin/ct completion bash) \
+      --zsh <($out/bin/ct completion zsh) \
+      --fish <($out/bin/ct completion fish) \
   '';
 
   meta = with lib; {
@@ -36,5 +43,6 @@ buildGoModule rec {
     homepage = "https://github.com/helm/chart-testing";
     license = licenses.asl20;
     maintainers = with maintainers; [ atkinschang ];
+    mainProgram = "ct";
   };
 }