From 148f8629cc00d5f71018e01abe301d0d052fbf4b Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Sun, 26 Apr 2020 13:16:57 +1000 Subject: [PATCH] gopass: use installShellFiles --- pkgs/tools/security/gopass/default.nix | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/pkgs/tools/security/gopass/default.nix b/pkgs/tools/security/gopass/default.nix index 8af24bf7ab52..cb640fb16393 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 = ''