{"id":14968067,"url":"https://github.com/71/nixcfg","last_synced_at":"2026-01-28T09:02:22.936Z","repository":{"id":57645179,"uuid":"147882492","full_name":"71/nixcfg","owner":"71","description":"Command line utility to query and modify .nix files.","archived":false,"fork":false,"pushed_at":"2018-09-09T11:25:29.000Z","size":10,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-09T22:24:30.088Z","etag":null,"topics":["nix","nixpkgs","rust","rust-bin"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/71.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}},"created_at":"2018-09-07T23:01:09.000Z","updated_at":"2024-03-01T11:47:04.000Z","dependencies_parsed_at":"2022-09-08T16:41:10.044Z","dependency_job_id":null,"html_url":"https://github.com/71/nixcfg","commit_stats":null,"previous_names":["6a/nixcfg"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/71/nixcfg","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/71%2Fnixcfg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/71%2Fnixcfg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/71%2Fnixcfg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/71%2Fnixcfg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/71","download_url":"https://codeload.github.com/71/nixcfg/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/71%2Fnixcfg/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28843119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T07:39:25.367Z","status":"ssl_error","status_checked_at":"2026-01-28T07:39:24.487Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["nix","nixpkgs","rust","rust-bin"],"created_at":"2024-09-24T13:39:11.727Z","updated_at":"2026-01-28T09:02:22.908Z","avatar_url":"https://github.com/71.png","language":"Rust","readme":"nixcfg\n======\n![Crates.io](https://img.shields.io/crates/v/nixcfg.svg)\n\nCommand line utility to query and modify .nix files.\n\n## Usage\n\n```\nnixcfg 0.1.0\nGrégoire Geis \u003cgit@gregoirege.is\u003e\nCommand line utility to query and modify .nix files.\n\nUSAGE:\n    nixcfg [FLAGS] [OPTIONS] \u003cSUBCOMMAND\u003e\n\nFLAGS:\n    -h, --help        Prints help information\n    -i, --in-place    Modify in place instead of printing result to stdout.\n    -V, --version     Prints version information\n\nOPTIONS:\n    -f, --file \u003cinput\u003e    Input .nix file to query or modify. [default: /etc/nixos/configuration.nix]\n\nSUBCOMMANDS:\n    get     Get the value at the given path.\n    set     Set the value at the given path.\n```\n\n## Examples\n\nLet's consider the following file:\n\n```nix\n# file.nix\n{ pkgs, config, ... }:\n\n{\n  environment.systemPackages = with pkgs; [ ];\n\n  networking.firewall.enable = true;\n  networking.firewall.allowedTCPPorts = [ 80 8080 8000 24800 ];\n\n  nixpkgs.config = { allowBroken = false; allowUnfree = true; };\n}\n```\n\n### Querying values\n- `nixpkg -f file.nix get environment.systemPackages` yields `with pkgs; [ ]`.\n- `nixpkg -f file.nix get nixpkgs.config` yields `{ allowBroken = false; allowUnfree = true; }`.\n- `nixpkg -f file.nix get nixpkgs.config.allowBroken` yields `false`.\n\n**Please note that `nixcfg` does not recognize values belonging to a same object.**\n- `nixpkg -f file.nix get networking.firewall.enable` yields `true`.\n- `nixpkg -f file.nix get networking.firewall.allowedTCPPorts` yields `[ 80 8080 8000 24800 ]`.\n- `nixpkg -f file.nix get networking.firewall` fails to find a matching value.\n\n### Updating values\n`nixpkg -f file.nix set networking.firewall.enable false`\n\nyields\n\n```nix\n# file.nix\n{ pkgs, config, ... }:\n\n{\n  environment.systemPackages = with pkgs; [ ];\n\n  networking.firewall.enable = false;\n  networking.firewall.allowedTCPPorts = [ 80 8080 8000 24800 ];\n\n  nixpkgs.config = { allowBroken = false; allowUnfree = true; };\n}\n```\n\n## To do\n- [ ] Add ability to insert the value, if the key did not previously exist.\n\n## Disclaimer\n\nThis project is very new, and has only been tested in limited test suites.  \nUse at your own risks.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F71%2Fnixcfg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F71%2Fnixcfg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F71%2Fnixcfg/lists"}