{"id":13635528,"url":"https://github.com/nix-community/nix-init","last_synced_at":"2026-03-11T04:04:19.778Z","repository":{"id":65347765,"uuid":"590605980","full_name":"nix-community/nix-init","owner":"nix-community","description":"Generate Nix packages from URLs with hash prefetching, dependency inference, license detection, and more [maintainer=@figsoda]","archived":false,"fork":false,"pushed_at":"2025-05-05T09:09:39.000Z","size":1288,"stargazers_count":1049,"open_issues_count":33,"forks_count":27,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-05-08T13:35:31.976Z","etag":null,"topics":["cargo","go","nix","nixpkgs","poetry","python","rust","template"],"latest_commit_sha":null,"homepage":"https://discourse.nixos.org/t/25035","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nix-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","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},"funding":{"open_collective":"nix-community"}},"created_at":"2023-01-18T19:45:48.000Z","updated_at":"2025-05-07T09:20:27.000Z","dependencies_parsed_at":"2023-10-28T03:25:10.164Z","dependency_job_id":"4d9a1fab-5097-4705-a075-d0f2713d0d93","html_url":"https://github.com/nix-community/nix-init","commit_stats":{"total_commits":659,"total_committers":10,"mean_commits":65.9,"dds":0.4157814871016692,"last_synced_commit":"5f8ab1c4f4b823376e1534e32e45dd905770858a"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fnix-init","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fnix-init/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fnix-init/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nix-community%2Fnix-init/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nix-community","download_url":"https://codeload.github.com/nix-community/nix-init/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253839100,"owners_count":21972269,"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":["cargo","go","nix","nixpkgs","poetry","python","rust","template"],"created_at":"2024-08-02T00:00:46.771Z","updated_at":"2026-03-11T04:04:19.773Z","avatar_url":"https://github.com/nix-community.png","language":"Rust","funding_links":["https://opencollective.com/nix-community"],"categories":["Applications","nix","Rust","Command-Line Tools"],"sub_categories":["Utilities","Discovery"],"readme":"\u003cimg src=\"assets/logo.svg\" align=\"right\" height=\"280\"\u003e\n\n# nix-init\n\n[![matrix](https://img.shields.io/matrix/nix-init:nixos.org?server_fqdn=matrix.org\u0026style=flat-square)](https://matrix.to/#/#nix-init:nixos.org)\n[![release](https://img.shields.io/github/v/release/nix-community/nix-init?logo=github\u0026style=flat-square)](https://github.com/nix-community/nix-init/releases)\n[![version](https://img.shields.io/crates/v/nix-init?logo=rust\u0026style=flat-square)](https://crates.io/crates/nix-init)\n[![license](https://img.shields.io/badge/license-MPL--2.0-blue?style=flat-square)](https://www.mozilla.org/en-US/MPL/2.0)\n[![ci](https://img.shields.io/github/checks-status/nix-community/nix-init/main?style=flat-square)](https://buildbot.nix-community.org/#/builders/2728)\n\nGenerate Nix packages from URLs\n\n\u003e Note: It is likely that the generated package will not work without some\n\u003e tweaks, also remember to double check the license and description even if it\n\u003e does work\n\n- Hash prefetching powered by [nurl] with support for `cargoHash` and\n  `vendorHash`\n- Dependency inference for Rust, Go, and Python projects\n- Interactive prompts with fuzzy tab completions\n- License detection\n\n![](https://user-images.githubusercontent.com/40620903/226211877-2d583d09-4fbc-4869-8248-6166edde21cc.gif)\n\n## Installation\n\nThe latest release of nix-init is packaged in nixpkgs and kept up to date on the\nunstable branches\n\n![](https://repology.org/badge/vertical-allrepos/nix-init.svg)\n\nIf you want to use a more recent snapshot of nix-init, it is also available as a\nflake. The following command is equivalent to running `nix-init --help`:\n\n```bash\nnix run github:nix-community/nix-init -- --help\n```\n\nor if you don't have flakes enabled:\n\n```bash\nnix run --extra-experimental-features \"flakes nix-command\" github:nix-community/nix-init -- --help\n```\n\n## Usage\n\n```\nUsage: nix-init [OPTIONS] [OUTPUT]\n\nArguments:\n  [OUTPUT]  The path or directory to output the generated file to\n\nOptions:\n  -u, --url \u003cURL\u003e                    Specify the URL\n      --rev \u003cREV\u003e                    Specify the tag or revision\n  -S, --submodules[=\u003cSUBMODULES\u003e]    Always fetch submodules when possible [possible values: true, false]\n  -V, --version [\u003cVERSION\u003e]          Specify the version of the package, or print nix-init version if no arguments are present\n      --pname \u003cPNAME\u003e                Specify the pname\n      --builder \u003cBUILDER\u003e            Specify the builder\n      --cargo-vendor \u003cCARGO_VENDOR\u003e  Specify how the cargo dependencies are vendored [possible values: fetchCargoVendor, importCargoLock]\n  -y, --overwrite[=\u003cOVERWRITE\u003e]      Always overwrite files [possible values: true, false]\n      --headless                     Don't prompt for anything (requires --url)\n  -n, --nixpkgs \u003cNIXPKGS\u003e            Path to nixpkgs (in nix)\n  -C, --commit[=\u003cCOMMIT\u003e]            Commit the changes if the output path is name-based (RFC 140) [possible values: true, false]\n  -c, --config \u003cCONFIG\u003e              Specify the config file\n  -h, --help                         Print help (see more with '--help')\n```\n\n### Supported builders\n\n- `stdenv.mkDerivation` and `stdenvNoCC.mkDerivation`\n- `buildRustPackage`\n- `buildPythonApplication` and `buildPythonPackage`\n- `buildGoModule`\n\n### Supported fetchers\n\n- `fetchCrate`\n- `fetchFromGitHub`\n- `fetchFromGitLab`\n- `fetchFromGitea`\n- `fetchPypi`\n- All other fetchers supported by [nurl] are also supported, you just have to\n  manually input the tag/revision of the package\n\n## Configuration\n\nnix-init will try to find `nix-init/config.toml` under XDG configuration\ndirectories\n\n```toml\n# ~/.config/nix-init/config.toml\n\n# maintainers that will get added to the package meta\nmaintainers = [\"figsoda\"]\n\n# path to nixpkgs (in nix), equivalent to `--nixpkgs`\nnixpkgs = \"\u003cnixpkgs\u003e\" # use the nixpkgs from channels (default)\n# nixpkgs = 'builtins.getFlake \"nixpkgs\"' # use the nixpkgs from the flake registry\n\n# commit the changes if the output path is name-based (RFC 140)\n# see https://github.com/NixOS/nixpkgs/tree/master/pkgs/by-name for more information\ncommit = true\n\n# access tokens to access private repositories and avoid rate limits\n[access-tokens]\n\"github.com\" = \"ghp_blahblahblah...\"\n\"gitlab.com\".command = [\"secret-tool\", \"or\", \"whatever\", \"you\", \"use\"]\n\"gitlab.gnome.org\".file = \"/path/to/api/token\"\n\n# if unspecified, nix-init tries to format the output file with nixfmt if it's found in PATH\n# the formatter should take a Nix file from stdin and output the formatted file to stdout\n[format]\ncommand = [\"alejandra\"]\n```\n\n## Changelog\n\nSee [CHANGELOG.md](CHANGELOG.md)\n\n[nurl]: https://github.com/nix-community/nurl\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnix-community%2Fnix-init","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnix-community%2Fnix-init","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnix-community%2Fnix-init/lists"}