···17out=${out:-}
18http_proxy=${http_proxy:-}
19000020# populated by clone_user_rev()
21fullRev=
22humanReadableRev=
···17out=${out:-}
18http_proxy=${http_proxy:-}
1920+# allow overwritting cacert's ca-bundle.crt with a custom one
21+# this can be done by setting NIX_GIT_SSL_CAINFO and NIX_SSL_CERT_FILE enviroment variables for the nix-daemon
22+GIT_SSL_CAINFO=${NIX_GIT_SSL_CAINFO:-$GIT_SSL_CAINFO}
23+24# populated by clone_user_rev()
25fullRev=
26humanReadableRev=
+4-6
pkgs/build-support/fetchgithub/default.nix
···23{ owner, repo, rev, name ? "source"
4, fetchSubmodules ? false, leaveDotGit ? null
5-, deepClone ? false, private ? false
6, githubBase ? "github.com", varPrefix ? null
7, ... # For hash agility
8}@args:
···10 baseUrl = "https://${githubBase}/${owner}/${repo}";
11 passthruAttrs = removeAttrs args [ "owner" "repo" "rev" "fetchSubmodules" "private" "githubBase" "varPrefix" ];
12 varBase = "NIX${if varPrefix == null then "" else "_${varPrefix}"}_GITHUB_PRIVATE_";
13- useFetchGit = fetchSubmodules || (leaveDotGit == true) || deepClone;
14 # We prefer fetchzip in cases we don't need submodules as the hash
15 # is more stable in that case.
16 fetcher = if useFetchGit then fetchgit else fetchzip;
···32 then {
33 inherit rev deepClone fetchSubmodules; url = "${baseUrl}.git";
34 } // lib.optionalAttrs (leaveDotGit != null) { inherit leaveDotGit; }
35- else ({ url = "${baseUrl}/archive/${rev}.tar.gz"; } // privateAttrs)
36- ) // passthruAttrs // { inherit name; };
37in
38-39-assert private -> !useFetchGit;
4041fetcher fetcherArgs // { meta.homepage = baseUrl; inherit rev; }