{"id":27958409,"url":"https://github.com/determinatesystems/nix-config-parser","last_synced_at":"2025-05-07T18:23:20.847Z","repository":{"id":90026355,"uuid":"595802650","full_name":"DeterminateSystems/nix-config-parser","owner":"DeterminateSystems","description":null,"archived":false,"fork":false,"pushed_at":"2025-05-04T00:12:51.000Z","size":61,"stargazers_count":8,"open_issues_count":8,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-04T01:19:15.660Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DeterminateSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-31T20:54:42.000Z","updated_at":"2024-12-09T05:35:23.000Z","dependencies_parsed_at":"2023-10-04T02:24:26.734Z","dependency_job_id":"53a3fbb5-00c5-4b18-a8e2-8d680a16f1ba","html_url":"https://github.com/DeterminateSystems/nix-config-parser","commit_stats":{"total_commits":38,"total_committers":1,"mean_commits":38.0,"dds":0.0,"last_synced_commit":"267e13fd338ffcd3539d3d328f0e05c544c163d4"},"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Fnix-config-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Fnix-config-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Fnix-config-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DeterminateSystems%2Fnix-config-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DeterminateSystems","download_url":"https://codeload.github.com/DeterminateSystems/nix-config-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252932217,"owners_count":21827250,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-07T18:23:20.082Z","updated_at":"2025-05-07T18:23:20.835Z","avatar_url":"https://github.com/DeterminateSystems.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nix-config-parser\n\nA simple parser for the Nix configuration file format.\n\nBased off of https://github.com/NixOS/nix/blob/0079d2943702a7a7fbdd88c0f9a5ad677c334aa8/src/libutil/config.cc#L80-L138.\n\n## Usage\n\n### Read from a file\n\n```rust\nuse std::error::Error;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    std::fs::write(\n       \"nix.conf\",\n       b\"experimental-features = flakes nix-command\\nwarn-dirty = false\\n\",\n    )?;\n\n    let nix_conf = nix_config_parser::NixConfig::parse_file(\u0026std::path::Path::new(\"nix.conf\"))?;\n\n    assert_eq!(\n       nix_conf.settings().get(\"experimental-features\").unwrap(),\n       \"flakes nix-command\"\n    );\n    assert_eq!(nix_conf.settings().get(\"warn-dirty\").unwrap(), \"false\");\n\n    std::fs::remove_file(\"nix.conf\")?;\n\n    Ok(())\n}\n```\n\n### Read from a string\n\n```rust\nuse std::error::Error;\n\nfn main() -\u003e Result\u003c(), Box\u003cdyn Error\u003e\u003e {\n    let nix_conf_string = String::from(\"experimental-features = flakes nix-command\");\n    let nix_conf = nix_config_parser::NixConfig::parse_string(nix_conf_string, None)?;\n\n    assert_eq!(\n        nix_conf.settings().get(\"experimental-features\").unwrap(),\n        \"flakes nix-command\"\n    );\n\n    Ok(())\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeterminatesystems%2Fnix-config-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeterminatesystems%2Fnix-config-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeterminatesystems%2Fnix-config-parser/lists"}