We just released v0.2 of nixfmt with important changes: We introduced atomic writes to make sure your code is not lost when nixfmt gets interrupted. We made sure nixfmt agrees with itself and won’t change the formatting of code that’s already formatted with it before. And last but not least: We improved the indentation algorithm by a lot.
We believe nixfmt is now pretty usable: There are still many corner cases that can be improved, but most of the formatting should now be clear and consistent. We want to invite you to start using nixfmt on your own code and report any issues. We’re also hoping to see some contributions soon.
cachix use nixfmt # Recommended, to get a cached build nix-env -i -f https://github.com/serokell/nixfmt/archive/v0.2.tar.gz nixfmt some.nix files.nix
edit: Changed links to refer to v0.2 branch which tracks some minor patches.