From ff3c08584919712dae9e8982358d0502e05213f4 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Thu, 18 Jun 2026 14:11:11 +1000 Subject: [PATCH] nixfmt-tree: fix passthru allows nixfmt-tree.check to be used --- pkgs/by-name/ni/nixfmt-tree/package.nix | 110 ++++++++++++------------ 1 file changed, 56 insertions(+), 54 deletions(-) diff --git a/pkgs/by-name/ni/nixfmt-tree/package.nix b/pkgs/by-name/ni/nixfmt-tree/package.nix index 2d5c3a7f1422..fd6a2de90225 100644 --- a/pkgs/by-name/ni/nixfmt-tree/package.nix +++ b/pkgs/by-name/ni/nixfmt-tree/package.nix @@ -54,7 +54,7 @@ let '' allRuntimeInputs; }; in -treefmtWithConfig.overrideAttrs { +treefmtWithConfig.overrideAttrs (prevAttrs: { meta = { mainProgram = "treefmt"; description = "Official Nix formatter zero-setup starter using treefmt"; @@ -118,63 +118,65 @@ treefmtWithConfig.overrideAttrs { platforms = lib.platforms.all; }; - passthru.tests.simple = - runCommand "nixfmt-tree-test-simple" - { - nativeBuildInputs = [ - git - nixfmt-tree - writableTmpDirAsHomeHook - ]; - } - '' - git config --global user.email "nix-builder@nixos.org" - git config --global user.name "Nix Builder" + passthru = prevAttrs.passthru // { + tests.simple = + runCommand "nixfmt-tree-test-simple" + { + nativeBuildInputs = [ + git + nixfmt-tree + writableTmpDirAsHomeHook + ]; + } + '' + git config --global user.email "nix-builder@nixos.org" + git config --global user.name "Nix Builder" - cat > unformatted.nix < unformatted.nix < formatted.nix < formatted.nix <