@@ -1,8 +1,9 @@
11{ stdenv, gitRepo, cacert, copyPathsToStore }:
22
33{ name, manifest, rev ? "HEAD", sha256
4+# Optional parameters:
45, repoRepoURL ? "", repoRepoRev ? "", referenceDir ? ""
5−, localManifests ? [], createMirror ? false, useArchive ? !createMirror
6+, localManifests ? [], createMirror ? false, useArchive ? false
67}:
78
89assert repoRepoRev != "" -> repoRepoURL != "";
@@ -51,6 +52,9 @@ in stdenv.mkDerivation {
5152 # Path must be absolute (e.g. for GnuPG: ~/.repoconfig/gnupg/pubring.kbx)
5253 export HOME="$(pwd)"
5354
55+ mkdir $out
56+ cd $out
57+
5458 mkdir .repo
5559 ${optionalString (local_manifests != []) ''
5660 mkdir .repo/local_manifests
@@ -61,6 +65,13 @@ in stdenv.mkDerivation {
6165
6266 repo init ${concatStringsSep " " repoInitFlags}
6367 repo sync --jobs=$NIX_BUILD_CORES --current-branch
64− ${optionalString (!createMirror) "rm -rf $out/.repo"}
68+
69+ # TODO: The git-index files (and probably the files in .repo as well) have
70+ # different contents each time and will therefore change the final hash
71+ # (i.e. creating a mirror probably won't work).
72+ ${optionalString (!createMirror) ''
73+ rm -rf .repo
74+ find -type d -name '.git' -prune -exec rm -rf {} +
75+ ''}
6576 '';
6677}