about summary refs log tree commit diff
path: root/nixpkgs/pkgs/tools/security/gopass/jsonapi.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/tools/security/gopass/jsonapi.nix')
-rw-r--r--nixpkgs/pkgs/tools/security/gopass/jsonapi.nix42
1 files changed, 42 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/tools/security/gopass/jsonapi.nix b/nixpkgs/pkgs/tools/security/gopass/jsonapi.nix
new file mode 100644
index 000000000000..e060adbf5bcf
--- /dev/null
+++ b/nixpkgs/pkgs/tools/security/gopass/jsonapi.nix
@@ -0,0 +1,42 @@
+{ lib
+, makeWrapper
+, buildGoModule
+, fetchFromGitHub
+, installShellFiles
+, gopass
+}:
+
+buildGoModule rec {
+  pname = "gopass-jsonapi";
+  version = "1.11.1";
+
+  src = fetchFromGitHub {
+    owner = "gopasspw";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "03xhza7n92xg12z83as9qdvvc0yx1qy6q0c7i4njvng594f9a8x2";
+  };
+
+  vendorSha256 = "0d4fyppsdfzvmjb0qvpnfnw0vl6z256bly7hfb0whk6rldks60wr";
+
+  subPackages = [ "." ];
+
+  nativeBuildInputs = [ installShellFiles makeWrapper ];
+
+  preBuild = ''
+    buildFlagsArray+=(
+      "-ldflags=-s -w -X main.version=${version} -X main.commit=${src.rev}"
+    )
+  '';
+
+  postFixup = ''
+    wrapProgram $out/bin/gopass-jsonapi --prefix PATH : "${lib.makeBinPath [ gopass ]}"
+  '';
+
+  meta = with lib; {
+    description = "Enables communication with gopass via JSON messages";
+    homepage = "https://www.gopass.pw/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ maxhbr ];
+  };
+}