Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleverness to merge extra-conf etc #174

Closed
Hoverbear opened this issue Jan 10, 2023 · 3 comments · Fixed by #263
Closed

Cleverness to merge extra-conf etc #174

Hoverbear opened this issue Jan 10, 2023 · 3 comments · Fixed by #263
Milestone

Comments

@Hoverbear
Copy link
Contributor

We should safely handle when a user adds options which we also set.

@Hoverbear
Copy link
Contributor Author

So Nix accepts this format: https://metacpan.org/pod/Config::General

Which I am not sure if there is a parser in Rust...

@Hoverbear
Copy link
Contributor Author

I almost wonder if it's worth trying to teach Nix to be configured with another format as well...

@cole-h
Copy link
Member

cole-h commented Jan 31, 2023

I was able to hack up a library that roughly parses the Nix config as Nix itself does: https://github.com/DeterminateSystems/nix-config-parser (Nix's implementation here: https://github.com/NixOS/nix/blob/0079d2943702a7a7fbdd88c0f9a5ad677c334aa8/src/libutil/config.cc#L80-L138)

For the moment, it's little more than a re-implementation of the parser code from Nix that puts the settings into a HashMap<String, String>. Maybe we could make that more useful (maybe make NixConfig a proper struct with helper methods for various things), if that would help.

@cole-h cole-h mentioned this issue Feb 22, 2023
18 tasks
@Hoverbear Hoverbear added this to the v0.5.0 milestone Mar 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants