about summary refs log tree commit diff
path: root/pkgs/aszlig
diff options
context:
space:
mode:
authoraszlig <aszlig@nix.build>2020-09-17 04:58:47 +0200
committeraszlig <aszlig@nix.build>2020-09-17 05:54:34 +0200
commit7b8164be35c9d82d6e7389a407150a9128f7fb0c (patch)
treeb9cd888948aa205712a6502d73807ef4dad83f0e /pkgs/aszlig
parent9aa9db32ce35774c124d6186a03006c9e345877f (diff)
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 <aszlig@nix.build>
Diffstat (limited to 'pkgs/aszlig')
-rw-r--r--pkgs/aszlig/gopass/default.nix43
1 files changed, 38 insertions, 5 deletions
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}";
+}