gopass-jsonapi: add version check

This commit is contained in:
Zexin Yuan
2025-12-14 10:54:53 +08:00
parent 5c929520c5
commit 27a4bf22d1

View File

@@ -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";