From 7b8164be35c9d82d6e7389a407150a9128f7fb0c Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 17 Sep 2020 04:58:47 +0200 Subject: aszlig/gopass: Downgrade to version 1.9.2 Version 1.10.X switches the default to new MIME-based format which breaks interoperability with pass and other implementations. I'd gladly switch to that format, but the 1.10.0 changelog also announces plans to remove support for GnuPG and Git in the long term: > The goal is to remove the support for multiple backends and any > external dependencies, including git and gpg binaries. GnuPG and Git support is the reason why I started using pass and ultimately switched to gopass. If the latter stops being a viable password manager, switching back to pass will be much harder with the new MIME format. There is also an upstream issue[1] about this and while I haven't read through *all* the comments, other people seem to have similar reasons for switching to gopass. So far however I'm not convinced that my use case will have a future with gopass, so I'll stay at 1.9.x until I've had the time to properly research other options or maybe even stay with gopass (and go all-in with the new MIME format). [1]: https://github.com/gopasspw/gopass/issues/1365 Signed-off-by: aszlig --- pkgs/aszlig/gopass/default.nix | 43 +++++++++++++++++++++++++++++++++++++----- 1 file changed, 38 insertions(+), 5 deletions(-) (limited to 'pkgs/aszlig') diff --git a/pkgs/aszlig/gopass/default.nix b/pkgs/aszlig/gopass/default.nix index 1120933b..c49aa503 100644 --- a/pkgs/aszlig/gopass/default.nix +++ b/pkgs/aszlig/gopass/default.nix @@ -1,7 +1,40 @@ -{ gopass }: +{ lib, buildGoModule, fetchFromGitHub, installShellFiles, makeWrapper +, git, gnupg, xclip, wl-clipboard -gopass.overrideAttrs (drv: { - patches = [ - ./use-color-in-pager.patch +, gopass +}: + +assert lib.versionOlder gopass.version "1.10.2"; + +buildGoModule rec { + pname = "gopass"; + version = "1.9.2"; + + src = fetchFromGitHub { + owner = "gopasspw"; + repo = pname; + rev = "v${version}"; + sha256 = "066dphw8xq0g72kj64sdai2yyllnr6ca27bfy5sxhk8x69j97rvz"; + }; + + patches = [ ./use-color-in-pager.patch ]; + vendorSha256 = "1wn20bh7ma4pblsf6qnlbz5bx4p9apig3d1yz7cpsqv4z3w07baw"; + nativeBuildInputs = [ installShellFiles makeWrapper ]; + doCheck = false; + + buildFlagsArray = [ + "-ldflags=-s -w -X main.version=${version} -X main.commit=${src.rev}" ]; -}) + + postInstall = '' + for shell in bash fish zsh; do + $out/bin/gopass completion "$shell" > "gopass.$shell" + installShellCompletion "gopass.$shell" + done + ''; + + postFixup = let + wrapperPath = lib.makeBinPath [ git gnupg xclip wl-clipboard ]; + extraPath = lib.escapeShellArg wrapperPath; + in "wrapProgram \"$out/bin/gopass\" --prefix PATH : ${extraPath}"; +} -- cgit 1.4.1