From 29af01593b1e2cb0913de5f7598de52daf194e33 Mon Sep 17 00:00:00 2001 From: nicknb Date: Tue, 2 Jun 2026 20:40:44 +0200 Subject: [PATCH] hut: add versionCheckHook Also fixes the embedded version string which was clarified [1] shall not include the 'v' prefix. [1]: https://todo.sr.ht/~xenrox/hut/72 --- pkgs/by-name/hu/hut/package.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/hu/hut/package.nix b/pkgs/by-name/hu/hut/package.nix index fe32cf221f19..bfcfdb1eedda 100644 --- a/pkgs/by-name/hu/hut/package.nix +++ b/pkgs/by-name/hu/hut/package.nix @@ -3,6 +3,7 @@ buildGoModule, fetchFromSourcehut, scdoc, + versionCheckHook, }: buildGoModule (finalAttrs: { @@ -18,6 +19,14 @@ buildGoModule (finalAttrs: { vendorHash = "sha256-7N+Zn7tzEG3dGeqNWmY98XUUKV7Y6g8wFZcQP9wea/8="; + nativeInstallCheckInputs = [ + versionCheckHook + ]; + + versionCheckProgramArg = "version"; + + doInstallCheck = true; + nativeBuildInputs = [ scdoc ]; @@ -25,8 +34,8 @@ buildGoModule (finalAttrs: { makeFlags = [ "PREFIX=$(out)" ]; ldflags = [ - # Recommended in 0.8.0 release notes https://git.sr.ht/~xenrox/hut/refs/v0.8.0 - "-X main.version=v${finalAttrs.version}" + # Recommended in 0.7.0 release notes https://git.sr.ht/~xenrox/hut/refs/v0.7.0 + "-X main.version=${finalAttrs.version}" ]; postBuild = ''