From 0950da84848f8a6d0092af66d505c968212cd330 Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Sat, 20 Dec 2025 15:48:30 +0000 Subject: [PATCH 1/2] hyperfine: Add `versionCheckHook` --- pkgs/by-name/hy/hyperfine/package.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/by-name/hy/hyperfine/package.nix b/pkgs/by-name/hy/hyperfine/package.nix index 3d7ce25bd9e3..74753af67c2e 100644 --- a/pkgs/by-name/hy/hyperfine/package.nix +++ b/pkgs/by-name/hy/hyperfine/package.nix @@ -4,6 +4,7 @@ fetchFromGitHub, installShellFiles, nix-update-script, + versionCheckHook, }: rustPlatform.buildRustPackage rec { @@ -31,6 +32,11 @@ rustPlatform.buildRustPackage rec { passthru.updateScript = nix-update-script { }; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + doInstallCheck = true; + meta = { description = "Command-line benchmarking tool"; homepage = "https://github.com/sharkdp/hyperfine"; From 67a98ca3c464248c76cc42d8db20272b42066f2f Mon Sep 17 00:00:00 2001 From: Jonathan Davies Date: Sat, 20 Dec 2025 15:53:15 +0000 Subject: [PATCH 2/2] hyperfine: Use `finalAttrs` --- pkgs/by-name/hy/hyperfine/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/hy/hyperfine/package.nix b/pkgs/by-name/hy/hyperfine/package.nix index 74753af67c2e..ca160b11d163 100644 --- a/pkgs/by-name/hy/hyperfine/package.nix +++ b/pkgs/by-name/hy/hyperfine/package.nix @@ -7,14 +7,14 @@ versionCheckHook, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "hyperfine"; version = "1.20.0"; src = fetchFromGitHub { owner = "sharkdp"; repo = "hyperfine"; - rev = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-Ee889Fx2Mi2005SrlcKc7TwG8ZIpTqisfLebXYadvSg="; }; @@ -40,7 +40,7 @@ rustPlatform.buildRustPackage rec { meta = { description = "Command-line benchmarking tool"; homepage = "https://github.com/sharkdp/hyperfine"; - changelog = "https://github.com/sharkdp/hyperfine/blob/v${version}/CHANGELOG.md"; + changelog = "https://github.com/sharkdp/hyperfine/blob/v${finalAttrs.version}/CHANGELOG.md"; license = with lib.licenses; [ asl20 # or mit @@ -51,4 +51,4 @@ rustPlatform.buildRustPackage rec { ]; mainProgram = "hyperfine"; }; -} +})