From cb3018882f13c5bfc835b46825fd0f2c532d7017 Mon Sep 17 00:00:00 2001 From: Daniel Nagy Date: Mon, 31 Mar 2025 21:00:00 +0200 Subject: [PATCH] vacuum-go: use finalAttrs pattern --- pkgs/by-name/va/vacuum-go/package.nix | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/va/vacuum-go/package.nix b/pkgs/by-name/va/vacuum-go/package.nix index c5da16a18cfd..cc6819cad37b 100644 --- a/pkgs/by-name/va/vacuum-go/package.nix +++ b/pkgs/by-name/va/vacuum-go/package.nix @@ -3,10 +3,9 @@ buildGoModule, fetchFromGitHub, testers, - vacuum-go, }: -buildGoModule rec { +buildGoModule (finalAttrs: { pname = "vacuum-go"; version = "0.16.5"; @@ -14,7 +13,7 @@ buildGoModule rec { owner = "daveshanley"; repo = "vacuum"; # using refs/tags because simple version gives: 'the given path has multiple possibilities' error - tag = "v${version}"; + tag = "v${finalAttrs.version}"; hash = "sha256-r42bmY7wmEjA2Q/k8czyyNpU59a4z6vxeCnIfMkMScg="; }; @@ -24,25 +23,25 @@ buildGoModule rec { ldflags = [ "-s" "-w" - "-X main.version=v${version}" + "-X main.version=v${finalAttrs.version}" ]; subPackages = [ "./vacuum.go" ]; passthru = { tests.version = testers.testVersion { - package = vacuum-go; + package = finalAttrs.finalPackage; command = "vacuum version"; - version = "v${version}"; + version = "v${finalAttrs.version}"; }; }; meta = { description = "The world's fastest OpenAPI & Swagger linter"; homepage = "https://quobix.com/vacuum"; - changelog = "https://github.com/daveshanley/vacuum/releases/tag/v${version}"; + changelog = "https://github.com/daveshanley/vacuum/releases/tag/v${finalAttrs.version}"; license = lib.licenses.mit; mainProgram = "vacuum"; maintainers = with lib.maintainers; [ konradmalik ]; }; -} +})