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/repo

Example 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

  • fetchFromGitHub
  • fetchFromGitLab
  • fetchFromSourcehut
  • fetchFromBitbucket
  • fetchFromGitea
  • fetchgit
  • fetchzip
  • fetchPypi
  • fetchCrate (crates.io)

Flags

FlagEffect
--fetcherForce a specific fetcher
--jsonOutput as JSON
--hashOutput only the hash
--list-fetchersList all supported fetchers