nurl
CLI tool to generate Nix fetcher expressions from repository URLs. Automatically prefetches and hashes the source so you can paste the output directly into a Nix derivation.
Usage
# GitHub repo
nurl https://github.com/owner/repo
# Specific ref/tag
nurl https://github.com/owner/repo v1.2.3
# GitLab
nurl https://gitlab.com/owner/repo
# Sourcehut
nurl https://git.sr.ht/~user/repo
# PyPI package
nurl --fetcher fetchPypi https://pypi.org/project/requests/
# Output as JSON
nurl --json https://github.com/owner/repoExample output
$ nurl https://github.com/zellij-org/zellij v0.39.2
fetchFromGitHub {
owner = "zellij-org";
repo = "zellij";
rev = "v0.39.2";
hash = "sha256-FSLbRfxSWY0a9H9iHT3oQ2SXwB70AwyH0Cm8sDZGaUk=";
}Supported fetchers
fetchFromGitHubfetchFromGitLabfetchFromSourcehutfetchFromBitbucketfetchFromGiteafetchgitfetchzipfetchPypifetchCrate(crates.io)
Flags
| Flag | Effect |
|---|---|
--fetcher | Force a specific fetcher |
--json | Output as JSON |
--hash | Output only the hash |
--list-fetchers | List all supported fetchers |