1 { fetchgit, fetchhg, fetchzip, lib }:
17 , fetchSubmodules ? false
18 , ... # For hash agility
21 assert (assertOneOf "vc" vc [ "hg" "git" ]);
24 urlFor = resource: "https://${resource}.${domain}/${owner}/${repo}";
28 } // removeAttrs args [
29 "owner" "repo" "rev" "domain" "vc" "name" "fetchSubmodules"
31 vcArgs = baseArgs // {
35 fetcher = if fetchSubmodules then vc else "zip";
39 arguments = vcArgs // { fetchSubmodules = true; };
43 arguments = vcArgs // { fetchSubrepos = true; };
47 arguments = baseArgs // {
48 url = "${baseUrl}/archive/${rev}.tar.gz";
49 postFetch = optionalString (vc == "hg") ''
50 rm -f "$out/.hg_archival.txt"
51 ''; # impure file; see #12002
53 gitRepoUrl = urlFor "git";
58 in cases.${fetcher}.fetch cases.${fetcher}.arguments // {
60 meta.homepage = "${baseUrl}";