You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
outputs.formatter.<system> output used by nix fmt and formats all .nix files in project. I believe, the flake.nix is manually formatted at this point...
Just checked, I have nix lsp (nil) and formatter (nixpkgs-fmt) installed.
Using it on my provided Flake in #200 doesn't change anything in the file, it "is already formatted". And it doesn't seem too far off what @xarvex was using when we fixed video playback on Nix and enabled hardware acceleration (#417). I triggered the formatter and it was changing nothing (though I was expecting many little changes).
However, the formatter has some very strong opinions about line breaks near curly braces (e.g. after let statements) and doesn't care at all about those when merging lists ([ ]) ++ ([ ]).
I've seen better, the formatter is far from rustfmt.
I simply chose one at the time and I don't have any strong preferences. But this topic seems to provide an abundance of choices for different alternatives instead of a common standard tool.
I'm still rather open to this, but ideally it should be simple, automatic and available for most code editors out there.
Thus far I have been using nixfmt-rfc-style as the formatter, as that is the official formatter used in nixpkgs. I can totally go ahead and expose the formatter attribute, I had forgotten about that.
Ouch, was a bit of a diff after that nix fmt, I think at some point I had removed the formatter from my PATH from my Nix configuration as I was putting all development tools into shells. But, at least the problem won't occur again. 😅
Checklist
Description
outputs.formatter.<system>
output used bynix fmt
and formats all.nix
files in project. I believe, theflake.nix
is manually formatted at this point...Solution
https://github.com/NixOS/nixfmt can be used
Alternatives
No response
The text was updated successfully, but these errors were encountered: