From e639244a29d37387d6c19b98e4a8263381f81da3 Mon Sep 17 00:00:00 2001 From: Defelo Date: Sat, 22 Feb 2025 11:34:23 +0100 Subject: [PATCH] difftastic: use finalAttrs pattern --- pkgs/by-name/di/difftastic/package.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/di/difftastic/package.nix b/pkgs/by-name/di/difftastic/package.nix index 1bdc604a48de..b5753e0713f0 100644 --- a/pkgs/by-name/di/difftastic/package.nix +++ b/pkgs/by-name/di/difftastic/package.nix @@ -6,14 +6,14 @@ nix-update-script, }: -rustPlatform.buildRustPackage rec { +rustPlatform.buildRustPackage (finalAttrs: { pname = "difftastic"; version = "0.63.0"; src = fetchFromGitHub { owner = "wilfred"; repo = "difftastic"; - tag = version; + tag = finalAttrs.version; hash = "sha256-BxWCSkSeDyiiGBY2u0ahPrIhYq2lbujoPPtZGq/OkI0="; }; @@ -21,9 +21,7 @@ rustPlatform.buildRustPackage rec { cargoHash = "sha256-kIqaZ8truDivMV6uo1+j9bmXQReREZjHSr89ZvVDWCw="; # skip flaky tests - checkFlags = [ - "--skip=options::tests::test_detect_display_width" - ]; + checkFlags = [ "--skip=options::tests::test_detect_display_width" ]; nativeInstallCheckInputs = [ versionCheckHook ]; versionCheckProgram = "${placeholder "out"}/bin/difft"; @@ -35,7 +33,7 @@ rustPlatform.buildRustPackage rec { meta = { description = "Syntax-aware diff"; homepage = "https://github.com/Wilfred/difftastic"; - changelog = "https://github.com/Wilfred/difftastic/blob/${version}/CHANGELOG.md"; + changelog = "https://github.com/Wilfred/difftastic/blob/${finalAttrs.src.rev}/CHANGELOG.md"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ ethancedwards8 @@ -45,4 +43,4 @@ rustPlatform.buildRustPackage rec { ]; mainProgram = "difft"; }; -} +})