git.iko.soy/typeable/nixpkgs
on master help sign in
gopass: Support passAlias parameter in derivation

Add a `passAlias` to `gopass` derivation, similarly to how there's `viAlias` parameter supported by vim/neovim derivations. Apart from convenience this is also necessary for e.g. making `docker-credential-helpers` work without patching the latter - the package uses `pass` executable from `PATH` https://github.com/docker/docker-credential-helpers/blob/f78081d1f7fef6ad74ad6b79368de6348386e591/pass/pass_linux.go#L67. By setting `passAlias` to `true` (e.g. via overlays like so: https://github.com/rvolosatovs/infrastructure/blob/94971f34db9df79b6666e626fa52840eb1fee840/nixpkgs/overlays.nix#L315-L317), secure Docker authentication via `gopass` "just works"™

commit67f7f93fd67eb8acf37afe096ad330cbd7f6e505 authorRoman Volosatovs <rvolosatovs@riseup.net> dateSun 5 Apr 2020, 20:36 (7 years ago) parentd9f4f06
1 file changed+10−1
pkgs/tools/security/gopass/default.nix+10−1
pkgs/tools/security/gopass/default.nix+10−1
@@ -1,4 +1,11 @@
1−{ stdenv, buildGoModule, fetchFromGitHub, git, gnupg, xclip, wl-clipboard, installShellFiles, makeWrapper }:
1+{ stdenv, makeWrapper
2+, buildGoModule, fetchFromGitHub, installShellFiles
3+, git
4+, gnupg
5+, xclip
6+, wl-clipboard
7+, passAlias ? false
8+}:
29
310buildGoModule rec {
411 pname = "gopass";
@@ -28,6 +35,8 @@ buildGoModule rec {
2835 $out/bin/gopass completion $shell > gopass.$shell
2936 installShellCompletion gopass.$shell
3037 done
38+ '' + stdenv.lib.optionalString passAlias ''
39+ ln -s $bin/bin/gopass $bin/bin/pass
3140 '';
3241
3342 postFixup = ''