keep-sorted: use finalAttrs

Signed-off-by: Paul Meyer <katexochen0@gmail.com>
This commit is contained in:
Paul Meyer 2025-04-11 12:59:18 +02:00
parent 2d23979ef5
commit cfe0dd5b45

View file

@ -6,14 +6,14 @@
versionCheckHook,
}:
buildGoModule rec {
buildGoModule (finalAttrs: {
pname = "keep-sorted";
version = "0.6.1";
src = fetchFromGitHub {
owner = "google";
repo = "keep-sorted";
tag = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-N/fJ0qj7/kQ9Q7ULpQpyhWAWFlnLkTjyNNKg8VhLvi0=";
};
@ -22,7 +22,7 @@ buildGoModule rec {
# Inject version string instead of reading version from buildinfo.
postPatch = ''
substituteInPlace main.go \
--replace-fail 'readVersion())' '"v${version}")'
--replace-fail 'readVersion())' '"v${finalAttrs.version}")'
'';
env.CGO_ENABLED = "0";
@ -41,11 +41,11 @@ buildGoModule rec {
passthru.updateScript = nix-update-script { };
meta = {
changelog = "https://github.com/google/keep-sorted/releases/tag/v${version}";
changelog = "https://github.com/google/keep-sorted/releases/tag/v${finalAttrs.version}";
description = "Language-agnostic formatter that sorts lines between two markers in a larger file";
homepage = "https://github.com/google/keep-sorted";
license = lib.licenses.asl20;
mainProgram = "keep-sorted";
maintainers = with lib.maintainers; [ katexochen ];
};
}
})