Make the bootsrap respect the contentAddressedByDefault setting

Patch every `derivation` call in the bootsrap process to add it a
conditional `__contentAddressed` parameter.

That way, passing `contentAddressedByDefault` means that the entire
build closure of a system can be content addressed
This commit is contained in:
regnat
2021-04-28 10:25:49 +02:00
parent 559c5792ef
commit 14f66d60a7
6 changed files with 33 additions and 11 deletions
+6 -2
View File
@@ -44,7 +44,7 @@ in rec {
stripAllFlags=" " # the Darwin "strip" command doesn't know "-s"
'';
bootstrapTools = derivation {
bootstrapTools = derivation ({
inherit system;
name = "bootstrap-tools";
@@ -54,7 +54,11 @@ in rec {
inherit (bootstrapFiles) mkdir bzip2 cpio tarball;
__impureHostDeps = commonImpureHostDeps;
};
} // lib.optionalAttrs (config.contentAddressedByDefault or false) {
__contentAddressed = true;
outputHashAlgo = "sha256";
outputHashMode = "recursive";
});
stageFun = step: last: {shell ? "${bootstrapTools}/bin/bash",
overrides ? (self: super: {}),