1 { lib, stdenvNoCC, mercurial }:
7 , fetchSubrepos ? false
8 , preferLocalBuild ? true }:
10 if hash != null && sha256 != null then
11 throw "Only one of sha256 or hash can be set"
13 # TODO: statically check if mercurial as the https support if the url starts woth https.
14 stdenvNoCC.mkDerivation {
15 name = "hg-archive" + (lib.optionalString (name != null) "-${name}");
16 builder = ./builder.sh;
17 nativeBuildInputs = [mercurial];
19 impureEnvVars = lib.fetchers.proxyImpureEnvVars;
21 subrepoClause = lib.optionalString fetchSubrepos "S";
23 outputHashAlgo = if hash != null then null else "sha256";
24 outputHashMode = "recursive";
25 outputHash = if hash != null then
27 else if sha256 != null then
33 inherit preferLocalBuild;