Is your feature request related to a problem? Please describe.
I'd like to use this to automatically format my NixOS configuration, but I don't like that it breaks Allman-style indentation. I know most people, especially in the Nix space, just put their opening curly bracket on the line that requires it, but this is more readable, to me.
I understand why it happens, it's so that code like this
module1 =
{ module2.enable = true; };
looks good and is indented, but, because nixpkgs-fmt does not look for lone curly brackets on a line, it unintentionally turns code that looks like this
module1 =
{
module2 =
{
enable = true;
};
};
into this
module1 =
{
module2 =
{
enable = true;
};
};
Describe the solution you'd like
I'd like to have it just let it be if it detects code styled like this.
Describe alternatives you've considered
A workaround would be to at least have the option to tell nixpkgs-fmt to let it be like this (a command line argument, an option in some config file etc.)
Additional context
Funnily enough, what this does right now is enforce GNU-style indentation