summary refs log tree commit diff
path: root/pkgs/tools/security/gopass
diff options
context:
space:
mode:
authorzowoq <59103226+zowoq@users.noreply.github.com>2020-04-26 13:16:57 +1000
committerzowoq <59103226+zowoq@users.noreply.github.com>2020-04-27 08:48:42 +1000
commit148f8629cc00d5f71018e01abe301d0d052fbf4b (patch)
tree631e67fab0216c632b2dc38aa74544f5e95b4761 /pkgs/tools/security/gopass
parente7b44787b1c5afe0bbe8fa351ce8d77ffa2c5ceb (diff)
downloadnixpkgs-148f8629cc00d5f71018e01abe301d0d052fbf4b.tar
nixpkgs-148f8629cc00d5f71018e01abe301d0d052fbf4b.tar.gz
nixpkgs-148f8629cc00d5f71018e01abe301d0d052fbf4b.tar.bz2
nixpkgs-148f8629cc00d5f71018e01abe301d0d052fbf4b.tar.lz
nixpkgs-148f8629cc00d5f71018e01abe301d0d052fbf4b.tar.xz
nixpkgs-148f8629cc00d5f71018e01abe301d0d052fbf4b.tar.zst
nixpkgs-148f8629cc00d5f71018e01abe301d0d052fbf4b.zip
gopass: use installShellFiles
Diffstat (limited to 'pkgs/tools/security/gopass')
-rw-r--r--pkgs/tools/security/gopass/default.nix15
1 files changed, 6 insertions, 9 deletions
diff --git a/pkgs/tools/security/gopass/default.nix b/pkgs/tools/security/gopass/default.nix
index 8af24bf7ab5..cb640fb1639 100644
--- a/pkgs/tools/security/gopass/default.nix
+++ b/pkgs/tools/security/gopass/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub, git, gnupg, xclip, wl-clipboard, makeWrapper }:
+{ stdenv, buildGoPackage, fetchFromGitHub, git, gnupg, xclip, wl-clipboard, installShellFiles, makeWrapper }:
 
 buildGoPackage rec {
   pname = "gopass";
@@ -6,7 +6,7 @@ buildGoPackage rec {
 
   goPackagePath = "github.com/gopasspw/gopass";
 
-  nativeBuildInputs = [ makeWrapper ];
+  nativeBuildInputs = [ installShellFiles makeWrapper ];
 
   src = fetchFromGitHub {
     owner = "gopasspw";
@@ -22,13 +22,10 @@ buildGoPackage rec {
   ] ++ stdenv.lib.optional stdenv.isLinux wl-clipboard);
 
   postInstall = ''
-    mkdir -p \
-      $bin/share/bash-completion/completions \
-      $bin/share/zsh/site-functions \
-      $bin/share/fish/vendor_completions.d
-    $bin/bin/gopass completion bash > $bin/share/bash-completion/completions/_gopass
-    $bin/bin/gopass completion zsh  > $bin/share/zsh/site-functions/_gopass
-    $bin/bin/gopass completion fish > $bin/share/fish/vendor_completions.d/gopass.fish
+    for shell in bash fish zsh; do
+      $bin/bin/gopass completion $shell > gopass.$shell
+      installShellCompletion gopass.$shell
+    done
   '';
 
   postFixup = ''