Unverified Commit 27a4bf22 authored by Zexin Yuan's avatar Zexin Yuan
Browse files

gopass-jsonapi: add version check

parent 5c929520
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -4,9 +4,11 @@
  buildGoModule,
  fetchFromGitHub,
  installShellFiles,
  writableTmpDirAsHomeHook,
  jq,
  gnupg,
  gopass,
  versionCheckHook,
}:

let
@@ -39,6 +41,7 @@ buildGoModule (finalAttrs: {
  nativeBuildInputs = [
    installShellFiles
    makeWrapper
    writableTmpDirAsHomeHook
  ];

  ldflags = [
@@ -50,7 +53,6 @@ buildGoModule (finalAttrs: {

  postInstall = ''
    # Generate native messaging manifests for Chrome and Firefox.
    export HOME=$(mktemp -d)
    ${gnupg}/bin/gpg --batch --passphrase "" --quick-generate-key "user <user@localhost>"
    ${gopass}/bin/gopass setup --name "user" --email "user@localhost"

@@ -93,6 +95,12 @@ buildGoModule (finalAttrs: {
      --prefix PATH : "${gopass.wrapperPath}"
  '';

  doInstallCheck = true;
  nativeInstallCheckInputs = [
    versionCheckHook
  ];
  versionCheckKeepEnvironment = [ "HOME" ];

  meta = {
    description = "Enables communication with gopass via JSON messages";
    homepage = "https://github.com/gopasspw/gopass-jsonapi";