mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 16:03:23 +00:00
fetchRepoProject: support hash
attribute, wrapping in withnormalizedHash
This commit is contained in:
parent
ac177dff93
commit
80cafd06e6
@ -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 {} +
|
||||
''}
|
||||
'';
|
||||
}
|
||||
}
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user