Problem
Attribute sets in the manual's examples do not properly escape keys when are, for example, paths. For the "Example" for an option, we see { /home/user = "foo"; } which is invalid Nix code instead of { "/home/user" = "foo"; } which is valid Nix code. This happens when the Nix options get builtins.toJSON run on them during the manual generation. In the wild, look at /mnt/btr_pool in the example of this option. Maybe the general opinion on this is, "obviously attrset keys can't be paths", but it tripped me up for a few minutes as a newcomer, and I think it could be a nice quality of life improvement.
Checklist
Proposal
Changing toJSON in Nix seems inappropriate, so maybe I could open a PR with a Nix function which escapes the problem attributes, but that might have performance issues. I am open to suggestions (or just marking it as "won't fix").
Problem
Attribute sets in the manual's examples do not properly escape keys when are, for example, paths. For the "Example" for an option, we see
{ /home/user = "foo"; }which is invalid Nix code instead of{ "/home/user" = "foo"; }which is valid Nix code. This happens when the Nix options getbuiltins.toJSONrun on them during the manual generation. In the wild, look at/mnt/btr_poolin the example of this option. Maybe the general opinion on this is, "obviously attrset keys can't be paths", but it tripped me up for a few minutes as a newcomer, and I think it could be a nice quality of life improvement.Checklist
Proposal
Changing
toJSONin Nix seems inappropriate, so maybe I could open a PR with a Nix function which escapes the problem attributes, but that might have performance issues. I am open to suggestions (or just marking it as "won't fix").