yubico-piv-tool: use finalAttrs pattern

This commit is contained in:
Anthony Roussel 2023-12-06 17:44:17 +01:00
parent 4a538e5e7b
commit 7e371b2c9b
No known key found for this signature in database
GPG Key ID: 9DC4987B1A55E75E

View File

@ -13,10 +13,9 @@
, withApplePCSC ? stdenv.isDarwin
, nix-update-script
, testers
, yubico-piv-tool
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "yubico-piv-tool";
version = "2.4.1";
@ -25,7 +24,7 @@ stdenv.mkDerivation rec {
src = fetchFromGitHub {
owner = "Yubico";
repo = "yubico-piv-tool";
rev = "refs/tags/yubico-piv-tool-${version}";
rev = "refs/tags/yubico-piv-tool-${finalAttrs.version}";
hash = "sha256-KprY5BX7Fi/qWRT1pda9g8fqnmDB1Bh7oFM7sCwViuw=";
};
@ -62,8 +61,7 @@ stdenv.mkDerivation rec {
extraArgs = [ "--version-regex" "yubico-piv-tool-([0-9.]+)$" ];
};
tests.version = testers.testVersion {
inherit version;
package = yubico-piv-tool;
package = finalAttrs.finalPackage;
command = "yubico-piv-tool --version";
};
};
@ -87,4 +85,4 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ viraptor anthonyroussel ];
mainProgram = "yubico-piv-tool";
};
}
})