updatecli: improve package quality

- remove superfluous use of `pname`
- add `testers.testVersion`
This commit is contained in:
Jan Moeller 2024-05-30 21:47:45 +02:00
parent afd3a57b83
commit dfd695979f
No known key found for this signature in database
GPG Key ID: 96A438F9EE72572F

View File

@ -4,6 +4,8 @@
, fetchFromGitHub
, nix-update-script
, installShellFiles
, testers
, updatecli
}:
buildGoModule rec {
@ -12,7 +14,7 @@ buildGoModule rec {
src = fetchFromGitHub {
owner = "updatecli";
repo = pname;
repo = "updatecli";
rev = "v${version}";
hash = "sha256-sBkTdr4/DqNrCxtaM1tVTx+rQ1dvJ1KwlFvAJHIZCuw=";
};
@ -32,7 +34,13 @@ buildGoModule rec {
"-X github.com/updatecli/updatecli/pkg/core/version.Version=${version}"
];
passthru.updateScript = nix-update-script { };
passthru = {
updateScript = nix-update-script { };
tests.version = testers.testVersion {
package = updatecli;
command = "updatecli version";
};
};
nativeBuildInputs = [ installShellFiles ];
@ -52,7 +60,7 @@ buildGoModule rec {
Updatecli is a command-line tool used to define and apply update strategies.
'';
homepage = "https://www.updatecli.io";
changelog = "https://github.com/updatecli/updatecli/releases/tag/v${version}";
changelog = "https://github.com/updatecli/updatecli/releases/tag/${src.rev}";
license = licenses.asl20;
mainProgram = "updatecli";
maintainers = with maintainers; [ croissong ];