Linting: Repeated or Grouped Keys - Polls

The reason I voted “I mostly prefer Grouped Keys” and not “I always prefer Grouped Keys” is because of the following example :

Strictly Repeated

{
  programs.a.enable = true;
  programs.b.enable = true;
  programs.c.enable = true;
  programs.d.enable = true;

  services.a.sync.enable = true;
}

Strictly Grouped

{
  programs = {
    a.enable = true;
    b.enable = true;
    c.enable = true;
    d.enable = true;
  };

  services.a.sync.enable = true;
}

Mostly Grouped, Few (Related ones) Repeated

{
  programs = {
    b.enable = true;
    c.enable = true;
    d.enable = true;
  };

  programs.a.enable = true;
  services.a.sync.enable = true;
}
3 Likes