mirror of
https://github.com/nix-community/nurl.git
synced 2024-10-26 20:19:56 +03:00
Generate Nix fetcher calls from repository URLs [maintainer=@figsoda]
bitbucketcodebergcratecratesfetchgitgiteagithubgitlabhgmercurialnixprefetchsourcehutstarred-nix-community-repostarred-reposvn
.github | ||
src | ||
tests | ||
.gitignore | ||
build.rs | ||
Cargo.lock | ||
Cargo.toml | ||
CHANGELOG.md | ||
flake.lock | ||
flake.nix | ||
LICENSE | ||
README.md | ||
rustfmt.toml |
nurl
Generate Nix fetcher calls from repository URLs
$ nurl https://github.com/nix-community/patsh v0.2.0 2>/dev/null
fetchFromGitHub {
owner = "nix-community";
repo = "patsh";
rev = "v0.2.0";
hash = "sha256-7HXJspebluQeejKYmVA7sy/F3dtU1gc4eAbKiPexMMA=";
}
Supported Fetchers
- fetchFromBitbucket
- fetchFromGitHub
- fetchFromGitLab
- fetchFromGitea
- fetchFromGitiles
- fetchFromRepoOrCz
- fetchFromSourcehut
- fetchgit
- fetchhg (requires
--fetcher fetchhg
)
Usage
Usage: nurl [OPTIONS] [URL] [REV]
Arguments:
[URL] URL to the repository to be fetched
[REV] the revision or reference to be fetched
Options:
-f, --fetcher <FETCHER> specify the fetcher function instead of inferring from the
URL [possible values: fetchFromBitbucket, fetchFromGitHub,
fetchFromGitLab, fetchFromGitea, fetchFromGitiles,
fetchFromRepoOrCz, fetchFromSourcehut, fetchgit, fetchhg]
-i, --indent <INDENT> extra indentation (in number of spaces) [default: 0]
-j, --json output in json format
-a, --arg <NAME> <EXPR> additional arguments to pass to the fetcher
-A, --arg-str <NAME> <STRING> same as --arg, but accepts strings instead Nix expressions
-o, --overwrite <NAME> <EXPR> overwrite arguments in the final output, not taken into
consideration when fetching the hash
-O, --overwrite-str <NAME> <STRING> same as --overwrite, but accepts strings instead Nix
expressions
-l, --list-fetchers List all available fetchers
-L, --list-possible-fetchers List all fetchers that can be generated without --fetcher
-h, --help Print help information
-V, --version Print version information
Comparison to nix-prefetch
nurl
infers the fetcher from the URL. Fornix-prefetch
, you need to pick the fetcher and supply the arguments manually.nix-prefetch
relies on FOD which is slow,nurl
tries to use alternatives when possible.nix-prefetch
supports arbitrary expressions (planned fornurl
) and file attributes.nix-prefetch
is more configurable and has an interface similar tonix-build
.nurl
has some nice features dedicated to generated packages (--indent
,--list-possible-fetchers
).
Changelog
See CHANGELOG.md