From eedc71d6488f5b2aaafa0b60b6229022aefddcb5 Mon Sep 17 00:00:00 2001 From: Archit Gupta Date: Wed, 15 Jan 2025 10:12:59 -0800 Subject: [PATCH] Support nix 2.25 in formatter Nix 2.25 changes the args passed to the formatter, so we now need to handle an empty args. See https://github.com/NixOS/nix/pull/11438 --- builtinModules/formatter.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/builtinModules/formatter.nix b/builtinModules/formatter.nix index ce6274b..a0734d9 100644 --- a/builtinModules/formatter.nix +++ b/builtinModules/formatter.nix @@ -42,6 +42,7 @@ in in pkgs.writeShellScriptBin "formatter" '' PATH=${if fullContext then "" else makeBinPath packages} + if [ $# -eq 0 ]; then exec "$0" .; fi for f in "$@"; do if [ -d "$f" ]; then ${fd}/bin/fd "$f" -Htf -x "$0" &