about 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:42 +1000
commit954eab8ea9e88680d86c9ca050e38dcec573fbc7 (patch)
treea6ec5836b94870977a44457634820be5859a9e55 /pkgs/applications/networking
parent16df60734a76eedbe3f265ee492587f1f42c4796 (diff)
downloadnixlib-954eab8ea9e88680d86c9ca050e38dcec573fbc7.tar
nixlib-954eab8ea9e88680d86c9ca050e38dcec573fbc7.tar.gz
nixlib-954eab8ea9e88680d86c9ca050e38dcec573fbc7.tar.bz2
nixlib-954eab8ea9e88680d86c9ca050e38dcec573fbc7.tar.lz
nixlib-954eab8ea9e88680d86c9ca050e38dcec573fbc7.tar.xz
nixlib-954eab8ea9e88680d86c9ca050e38dcec573fbc7.tar.zst
nixlib-954eab8ea9e88680d86c9ca050e38dcec573fbc7.zip
stern: use installShellFiles
Diffstat (limited to 'pkgs/applications/networking')
-rw-r--r--pkgs/applications/networking/cluster/stern/default.nix12
1 files changed, 7 insertions, 5 deletions
diff --git a/pkgs/applications/networking/cluster/stern/default.nix b/pkgs/applications/networking/cluster/stern/default.nix
index 144d46043ffe..95ad965c346f 100644
--- a/pkgs/applications/networking/cluster/stern/default.nix
+++ b/pkgs/applications/networking/cluster/stern/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, buildPackages, buildGoPackage, fetchFromGitHub }:
+{ stdenv, lib, buildPackages, buildGoPackage, fetchFromGitHub, installShellFiles }:
 
 let isCrossBuild = stdenv.hostPlatform != stdenv.buildPlatform; in
 
@@ -17,13 +17,15 @@ buildGoPackage rec {
 
   goDeps = ./deps.nix;
 
+  nativeBuildInputs = [ installShellFiles ];
+
   postInstall =
     let stern = if isCrossBuild then buildPackages.stern else "$bin"; in
     ''
-      mkdir -p $bin/share/bash-completion/completions
-      ${stern}/bin/stern --completion bash > $bin/share/bash-completion/completions/stern
-      mkdir -p $bin/share/zsh/site-functions
-      ${stern}/bin/stern --completion zsh > $bin/share/zsh/site-functions/_stern
+      for shell in bash zsh; do
+        ${stern}/bin/stern --completion $shell > stern.$shell
+        installShellCompletion stern.$shell
+      done
     '';
 
   meta = with lib; {