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
{{ message }}
Repository navigation
The option to use nix fmt (or a wrapper like Mic92/flake-fmt) instead for formatting instead of the configured package #1671
I have verified that this feature request has not been made before
I have checked the issues tab, and did not find a similar feature request. I understand that my issue will be closed if it is a duplicate.
Feature Type
Other
Feature description
I'd like to be able to use the formatter provided by a project flake instead of the formatter I configured in nvf if it's available. My nvf configuration is set to format-on-save so the formatter is run quite regularly and I'd like it to use the actual formatter I want to use immediately instead of the "fallback" I configured in the nvf config for the case that there is no project provided formatter output.
Alternatives
Currently I manually run nix fmt manually every once in a while. I also configured some of the formatters in nvf directly but those might not comply with the project provided formatter settings (when using treefmt for example)
Additional Context
Thanks for building nvf! It's a really useful tool to me.
My idea was to have formatOnSave try to identify a flake.nix in the file and check whether it has a formatter configured for the architecture we're on. If yes, use that formatter when the keybind is used or formatOnSave is triggered. If not then just fall back to the configured formatter by conform.nvim
I dont think this is in the scope of generaly nvf.
You could write a conform formatter like that, and enable it via project level .nvimrc.
heck the formatter itself could also live in nvf. But I don't think it should be a default but an optional one. also making it to intrusive into the maintenance of other modules, would be bad as well.
Also nothing garantues that nix fmt is actually a compatible format for conform, as it can just be artbitrary scripts, of which you wouldnt get the logs.
Activity
snoweuph commentedon Jun 26, 2026
Do you mean run a different bin, so like:
running the
gofmtinPATHinstead of from a specific nix store?in that case, you can just override the
cmdto use the path instead for your formatters.ItsLiyua commentedon Jun 27, 2026
My idea was to have formatOnSave try to identify a flake.nix in the file and check whether it has a formatter configured for the architecture we're on. If yes, use that formatter when the keybind is used or formatOnSave is triggered. If not then just fall back to the configured formatter by conform.nvim
snoweuph commentedon Jun 27, 2026
I dont think this is in the scope of generaly nvf.
You could write a conform formatter like that, and enable it via project level
.nvimrc.heck the formatter itself could also live in nvf. But I don't think it should be a default but an optional one. also making it to intrusive into the maintenance of other modules, would be bad as well.
Also nothing garantues that nix fmt is actually a compatible format for conform, as it can just be artbitrary scripts, of which you wouldnt get the logs.