diff --git a/pkgs/by-name/tp/tpnote/package.nix b/pkgs/by-name/tp/tpnote/package.nix index d770c2e190d1..d81707fe938b 100644 --- a/pkgs/by-name/tp/tpnote/package.nix +++ b/pkgs/by-name/tp/tpnote/package.nix @@ -7,17 +7,18 @@ oniguruma, installShellFiles, tpnote, - testers, + versionCheckHook, + nix-update-script, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "tpnote"; version = "1.25.14"; src = fetchFromGitHub { owner = "getreu"; repo = "tp-note"; - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-CgC4aLg1GdqDXzuWfV4i5C4//I3GJ2RJa0y3oFOM0II="; }; @@ -39,19 +40,27 @@ rustPlatform.buildRustPackage rec { RUSTONIG_SYSTEM_LIBONIG = true; - passthru.tests.version = testers.testVersion { package = tpnote; }; - # The `tpnote` crate has no unit tests. All tests are in `tpnote-lib`. checkType = "debug"; cargoTestFlags = "--package tpnote-lib"; doCheck = true; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + versionCheckProgramArg = "--version"; + doInstallCheck = true; + + passthru = { + updateScript = nix-update-script { }; + }; + meta = { - changelog = "https://github.com/getreu/tp-note/releases/tag/v${version}"; + changelog = "https://github.com/getreu/tp-note/releases/tag/v${finalAttrs.version}"; description = "Markup enhanced granular note-taking"; homepage = "https://blog.getreu.net/projects/tp-note/"; license = lib.licenses.mit; mainProgram = "tpnote"; maintainers = with lib.maintainers; [ getreu ]; }; -} +})