News for hackers. Stuff that matters.
Re:How Nix and NixOS get so close to perfect by dotancohen on Sunday April 24, 2022 @08:18AM (#31143345)
So long as the parser doesn't except on undefined keys, you can add pseudo-comments to many places in a JSON config file.

  {
    "foo": "bar",
    "COMMENT": "This bars the foo"
  }
Re:How Nix and NixOS get so close to perfect by viraptor on Sunday April 24, 2022 @09:03AM (#31143561)
That still doesn't let you comment on items in the list, or on elements of actual maps - for example if those were environment variables, now you've got a random "COMMENT" variable.
Re:How Nix and NixOS get so close to perfect by dotancohen on Sunday April 24, 2022 @10:59AM (#31144640)
Sure, it's a hack, but it's a useful hack that works in many places.
Re:How Nix and NixOS get so close to perfect by ithkuil on Sunday April 24, 2022 @08:22AM (#31143359)
If it doesn't error in undefined keys you cannot help people figuring out when they introduced a typo in their config