diff --git a/formatter.nix b/formatter.nix index 24396c2..fbdaa91 100644 --- a/formatter.nix +++ b/formatter.nix @@ -26,7 +26,7 @@ let deadnix --no-lambda-pattern-names --edit "$@" # Use git to traverse since nixfmt doesn't have good traversal - git ls-files "$@" | grep '\.nix$' | xargs --no-run-if-empty nixfmt + git ls-files -z "$@" | grep --null '\.nix$' | xargs --null --no-run-if-empty nixfmt ''; meta = { diff --git a/lib/default.nix b/lib/default.nix index 29a5471..5dc7cc4 100644 --- a/lib/default.nix +++ b/lib/default.nix @@ -467,7 +467,7 @@ let fi # Use git to traverse since nixfmt doesn't have good traversal - git ls-files "$@" | grep '\.nix$' | xargs --no-run-if-empty nixfmt + git ls-files -z "$@" | grep --null '\.nix$' | xargs --null --no-run-if-empty nixfmt ''; }) );