Open hansl opened 3 years ago
This is not possible without changing Nix itself. If you want JSON5 to be added then it will require to extend builtins.fromJSON
with that support, or introduce a new builtins.fromJSON5
builtin.
I agree with zimbatm that we should wait for a nix builtins before supporting JSON5. The alternative is to use the "import from derivation", which may not be appropriate in all niv use cases.
I tried implementing the feature by using by catching the fromJSON error in hope of falling back to a implementation of fromJSON using import from derivation. It didn't looks it was possible to catch this fromJSON error. This solution would also need changing nix itself.
Actually, a different possibility would be to serialize the file as Nix. It supports JSON-like data structures, and comments.
+1 to have comments