A CLI tool that automatically generates Nix fetcher calls from repository URLs, simplifying package definitions.
nurl is a command-line tool that automatically generates Nix fetcher expressions from repository URLs. It solves the problem of manually writing and maintaining boilerplate Nix code for fetching dependencies by inferring the correct fetcher, retrieving the hash, and producing a complete expression.
Nix users and package maintainers who need to create or update Nix package definitions that fetch sources from various repositories and package registries.
Developers choose nurl because it automates a tedious part of Nix packaging, reduces errors in hash generation, supports a wide range of fetchers, and integrates well with tools like nix-init for broader package generation workflows.
Generate Nix fetcher calls from URLs [maintainer=@figsoda]
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Detects the correct Nix fetcher from the URL, such as fetchFromGitHub for GitHub repos, reducing manual errors. The README lists 18+ supported fetchers including fetchCrate and fetchPypi.
Fetches and includes the content hash in the output expression, ensuring reproducibility. It uses faster alternatives to Fixed-Output Derivations when possible for improved performance.
Offers JSON output, custom indentation, and argument overwrites, as shown with flags like --json and --overwrite. This allows seamless integration into various packaging workflows.
Supports 18+ fetchers from platforms like GitHub, GitLab, PyPI, and crates.io, making it versatile for diverse package sources. The --list-fetchers option enumerates all available fetchers.
Compared to nix-prefetch, nurl is less configurable and lacks support for file attributes, as noted in the README comparison, which may hinder advanced use cases.
Requires internet access to fetch hashes, making it unsuitable for offline environments or private repos without authentication workarounds.
Automatic fetcher inference can fail for obscure or custom URLs, forcing users to manually specify fetchers with --fetcher, adding complexity.