Skip to content

nix.conf.json #8373

@roberth

Description

@roberth

Is your feature request related to a problem? Please describe.

The config format is a bit fragile. Let's use semi-structured data instead. This enables us to accept more complex settings where it makes sense; for instance a JSON object ("attrset") would be great for configuring individual stores.

Describe the solution you'd like

Allow "nix.conf" to be specified in JSON instead.
nlohmann_json has support for stripping out comments.

No more escaping, no more text parsing, and support for a wider range of values. Great compatibility with the Nix language as well.

Describe alternatives you've considered

Configuration formats like YAML, TOML may be considered. These aren't quite as easy to generate or parse.
YAML is too fragile (Norway problem, etc)
TOML would bias our data model away from composable structures.
Nix is not actually easy to generate from Nix, and needing an evaluator to configure the evaluator would complicate initialization.

Additional context

Priorities

Add 👍 to issues you find important.

Metadata

Metadata

Assignees

No one assigned

    Labels

    UXThe way in which users interact with Nix. Higher level than UI.featureFeature request or proposalsettingsSettings, global flags, nix.conf

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions