fetchRepoProject: support hash attribute, wrapping in withnormalizedHash

This commit is contained in:
nicoo 2024-09-15 09:53:12 +00:00
parent ac177dff93
commit 80cafd06e6

View File

@ -1,15 +1,15 @@
{ lib, stdenvNoCC, gitRepo, cacert, copyPathsToStore }:
lib.fetchers.withNormalizedHash { } (
{ name, manifest, rev ? "HEAD", outputHash, outputHashAlgo
# Optional parameters:
, repoRepoURL ? "", repoRepoRev ? "", referenceDir ? "", manifestName ? ""
, localManifests ? [], createMirror ? false, useArchive ? false
}:
{ name, manifest, rev ? "HEAD", sha256
# Optional parameters:
, repoRepoURL ? "", repoRepoRev ? "", referenceDir ? "", manifestName ? ""
, localManifests ? [], createMirror ? false, useArchive ? false
}:
assert repoRepoRev != "" -> repoRepoURL != "";
assert createMirror -> !useArchive;
assert repoRepoRev != "" -> repoRepoURL != "";
assert createMirror -> !useArchive;
let
let
inherit (lib)
concatMapStringsSep
concatStringsSep
@ -34,14 +34,13 @@ let
local_manifests = copyPathsToStore localManifests;
in stdenvNoCC.mkDerivation {
in stdenvNoCC.mkDerivation {
inherit name;
inherit cacert manifest rev repoRepoURL repoRepoRev referenceDir; # TODO
outputHashAlgo = "sha256";
inherit outputHash outputHashAlgo;
outputHashMode = "recursive";
outputHash = sha256;
preferLocalBuild = true;
enableParallelBuilding = true;
@ -80,4 +79,5 @@ in stdenvNoCC.mkDerivation {
find -type d -name '.git' -prune -exec rm -rf {} +
''}
'';
}
}
)