summary refs log tree commit diff
path: root/pkgs/applications/networking
diff options
context:
space:
mode:
authorzowoq <59103226+zowoq@users.noreply.github.com>2020-04-26 13:16:52 +1000
committerzowoq <59103226+zowoq@users.noreply.github.com>2020-04-27 08:48:36 +1000
commit16df60734a76eedbe3f265ee492587f1f42c4796 (patch)
tree52e0fce79a8613eb1ff31d15173d8849c6448dc3 /pkgs/applications/networking
parent7a40eb5763a13f68af5d7f74cae166d6c2d73c4d (diff)
downloadnixpkgs-16df60734a76eedbe3f265ee492587f1f42c4796.tar
nixpkgs-16df60734a76eedbe3f265ee492587f1f42c4796.tar.gz
nixpkgs-16df60734a76eedbe3f265ee492587f1f42c4796.tar.bz2
nixpkgs-16df60734a76eedbe3f265ee492587f1f42c4796.tar.lz
nixpkgs-16df60734a76eedbe3f265ee492587f1f42c4796.tar.xz
nixpkgs-16df60734a76eedbe3f265ee492587f1f42c4796.tar.zst
nixpkgs-16df60734a76eedbe3f265ee492587f1f42c4796.zip
kops: use installShellFiles
Diffstat (limited to 'pkgs/applications/networking')
-rw-r--r--pkgs/applications/networking/cluster/kops/default.nix12
1 files changed, 6 insertions, 6 deletions
diff --git a/pkgs/applications/networking/cluster/kops/default.nix b/pkgs/applications/networking/cluster/kops/default.nix
index a5f1806e577..4d2e406c040 100644
--- a/pkgs/applications/networking/cluster/kops/default.nix
+++ b/pkgs/applications/networking/cluster/kops/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, buildGoPackage, fetchFromGitHub, go-bindata }:
+{ stdenv, lib, buildGoPackage, fetchFromGitHub, go-bindata, installShellFiles }:
 
 let
   goPackagePath = "k8s.io/kops";
@@ -18,7 +18,7 @@ let
           inherit sha256;
         };
 
-        nativeBuildInputs = [ go-bindata ];
+        nativeBuildInputs = [ go-bindata installShellFiles ];
         subPackages = [ "cmd/kops" ];
 
         buildFlagsArray = ''
@@ -33,10 +33,10 @@ let
         '';
 
         postInstall = ''
-          mkdir -p $bin/share/bash-completion/completions
-          mkdir -p $bin/share/zsh/site-functions
-          $bin/bin/kops completion bash > $bin/share/bash-completion/completions/kops
-          $bin/bin/kops completion zsh > $bin/share/zsh/site-functions/_kops
+          for shell in bash zsh; do
+            $bin/bin/kops completion $shell > kops.$shell
+            installShellCompletion kops.$shell
+          done
         '';
 
         meta = with stdenv.lib; {