As soon as the keys’ names are longer than an indentation (nixfmt: 2 characters), grouping is more horizontal-space efficient
Nope, that’s not always true.
Consider this example:
{
aaa.bbb = 111;
aaa.ccc = {
ddd = 222;
eee = 333;
};
}
Packing aaa would result in:
{
aaa = {
bbb = 111;
ccc = {
ddd = 222;
eee = 333;
};
};
}
In this case ddd = 222; got shifted right by 2 characters, and more horizontal space got used.
And that’s not made up. The increased indentation by 5 levels I was talking about is exactly like that. Grouping increases outer indentation levels, but the actual lines that get indented aren’t getting simplified by grouping at all.