prs: modernize

* Prefer `tag` over `rev` in `fetchFromGitLab`
* Add `versionCheckHook`
* Prefer `finalAttrs` over `rec`
* Add updateScript
This commit is contained in:
Kenichi Kamiya
2025-11-01 17:39:11 +09:00
parent 631818fdff
commit 9f0321046e
+14 -4
View File
@@ -10,16 +10,18 @@
gtk3,
stdenv,
writableTmpDirAsHomeHook,
versionCheckHook,
nix-update-script,
}:
rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage (finalAttrs: {
pname = "prs";
version = "0.5.4";
src = fetchFromGitLab {
owner = "timvisee";
repo = "prs";
rev = "refs/tags/v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-RWquV2apUazgGiwzTc0cMzKNItJOBZDSRMp13k+mhS0=";
};
@@ -54,10 +56,18 @@ rustPlatform.buildRustPackage rec {
done
'';
nativeInstallCheckInputs = [
versionCheckHook
];
doInstallCheck = true;
versionCheckProgramArg = "--version";
passthru.updateScript = nix-update-script { };
meta = {
description = "Secure, fast & convenient password manager CLI using GPG and git to sync";
homepage = "https://gitlab.com/timvisee/prs";
changelog = "https://gitlab.com/timvisee/prs/-/blob/v${version}/CHANGELOG.md";
changelog = "https://gitlab.com/timvisee/prs/-/blob/v${finalAttrs.version}/CHANGELOG.md";
license = with lib.licenses; [
lgpl3Only # lib
gpl3Only # everything else
@@ -65,4 +75,4 @@ rustPlatform.buildRustPackage rec {
maintainers = with lib.maintainers; [ colemickens ];
mainProgram = "prs";
};
}
})