8 lib.fetchers.withNormalizedHash { } (
15 # Optional parameters:
25 assert repoRepoRev != "" -> repoRepoURL != "";
26 assert createMirror -> !useArchive;
36 extraRepoInitFlags = [
37 (optionalString (repoRepoURL != "") "--repo-url=${repoRepoURL}")
38 (optionalString (repoRepoRev != "") "--repo-branch=${repoRepoRev}")
39 (optionalString (referenceDir != "") "--reference=${referenceDir}")
40 (optionalString (manifestName != "") "--manifest-name=${manifestName}")
44 "--manifest-url=${manifest}"
45 "--manifest-branch=${rev}"
47 (optionalString createMirror "--mirror")
48 (optionalString useArchive "--archive")
49 ] ++ extraRepoInitFlags;
51 local_manifests = copyPathsToStore localManifests;
54 stdenvNoCC.mkDerivation {
66 inherit outputHash outputHashAlgo;
67 outputHashMode = "recursive";
69 preferLocalBuild = true;
70 enableParallelBuilding = true;
72 impureEnvVars = fetchers.proxyImpureEnvVars ++ [
82 GIT_SSL_CAINFO = "${cacert}/etc/ssl/certs/ca-bundle.crt";
85 # Path must be absolute (e.g. for GnuPG: ~/.repoconfig/gnupg/pubring.kbx)
92 ${optionalString (local_manifests != [ ]) ''
93 mkdir .repo/local_manifests
94 for local_manifest in ${concatMapStringsSep " " toString local_manifests}; do
95 cp $local_manifest .repo/local_manifests/$(stripHash $local_manifest)
99 repo init ${concatStringsSep " " repoInitFlags}
100 repo sync --jobs=$NIX_BUILD_CORES --current-branch
102 # TODO: The git-index files (and probably the files in .repo as well) have
103 # different contents each time and will therefore change the final hash
104 # (i.e. creating a mirror probably won't work).
105 ${optionalString (!createMirror) ''
107 find -type d -name '.git' -prune -exec rm -rf {} +