fetchFromGitiles: init

This has the same motivation as fetchFromGitHub/fetchFromGitLab --
it's cheaper to download a tarball of a single revision than it is to
download a whole history.

I could have gone with domain/group/repo, like fetchFromGitLab, but it
would have made implementation more difficult, and this syntax means
it's a drop-in replacement for fetchgit, so I decided it wasn't worth
it.
This commit is contained in:
Alyssa Ross
2019-12-02 22:44:33 +00:00
parent a8508f7266
commit fe16f7d7f9
3 changed files with 23 additions and 0 deletions
@@ -0,0 +1,10 @@
{ fetchzip, lib }:
{ url, rev, name ? "source", ... } @ args:
fetchzip ({
inherit name;
url = "${url}/+archive/${rev}.tar.gz";
stripRoot = false;
meta.homepage = url;
} // removeAttrs args [ "url" "rev" ]) // { inherit rev; }