nixfmt-tree: refactor impl to use treefmt.withConfig
#391319
Open
+73
−34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Follow up to #390147 and #384857, this PR refactors the new
nixfmt-tree
package to make use of the newtreefmt.withConfig
wrapper.This is technically a breaking change:
settings
will no longer entirely replace all settings,instead settings are now merged as modules.
nixfmt
) available on the PATH,only the wrapped
treefmt
will be added to the shell's PATH.There are also non-breaking changes:
runtimePackages
was renamed toruntimeInputs
. For consistency withtreefmt.withConfig
and other parts of nixpkgs, such aswriteShellApplication
.runtimeInputs
is overridden to a list without a nixfmt package. In such cases, users should probably just usetreefmt.withConfig
.We could have it so that runtime inputs still end up being installed to
$out/bin/
, but this would negate much of the advantage of delegating most impl-details totreefmt.withConfig
. In hindsight, it also feels like a bit of a leaky abstraction?cc @infinisil @NixOS/nix-formatting
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-build -A nixfmt-tree.tests
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.