Open
Description
Is your feature request related to a problem
nix can't natively parse JSONC.
more specifically, I had to manually remove trailing commas from bun.lock
to parse it into nix object.
Proposed solution
add builtin function builtins.fromJSONC
JSONC doesn't have "one universal standard", but it's generally assumed to be JSON superset with C-style comments (//
and /* */
) and trailing commas allowed (but not required)
Alternative solutions
- add support for JSON5, which is superset of JSONC and has a universal standard https://json5.org/
- use some package from nixpkgs to parse it (IFD)
- manually remove comments and trailing commas from JSONC to then parse with
builtins.fromJSON
Additional context
Checklist
- checked latest Nix manual (source)
- checked open feature issues and pull requests for possible duplicates
Add 👍 to issues you find important.