config.contentAddressedByDefault: init option

This commit is contained in:
Artturin 2022-04-27 23:21:32 +03:00
parent d76021402d
commit 33415135b0
7 changed files with 10 additions and 6 deletions

View File

@ -75,7 +75,7 @@ rec {
inherit (bootstrapFiles) mkdir bzip2 cpio tarball;
__impureHostDeps = commonImpureHostDeps;
} // lib.optionalAttrs (config.contentAddressedByDefault or false) {
} // lib.optionalAttrs config.contentAddressedByDefault {
__contentAddressed = true;
outputHashAlgo = "sha256";
outputHashMode = "recursive";

View File

@ -182,7 +182,7 @@ in
buildInputs = [ make ];
mkdir = "/bin/mkdir";
ln = "/bin/ln";
} // lib.optionalAttrs (config.contentAddressedByDefault or false) {
} // lib.optionalAttrs config.contentAddressedByDefault {
__contentAddressed = true;
outputHashAlgo = "sha256";
outputHashMode = "recursive";

View File

@ -90,7 +90,7 @@ let
allowedRequisites = allowedRequisites
++ defaultNativeBuildInputs ++ defaultBuildInputs;
}
// lib.optionalAttrs (config.contentAddressedByDefault or false) {
// lib.optionalAttrs config.contentAddressedByDefault {
__contentAddressed = true;
outputHashAlgo = "sha256";
outputHashMode = "recursive";

View File

@ -93,7 +93,7 @@ in
, __contentAddressed ?
(! attrs ? outputHash) # Fixed-output drvs can't be content addressed too
&& (config.contentAddressedByDefault or false)
&& config.contentAddressedByDefault
, ... } @ attrs:

View File

@ -66,7 +66,7 @@ let
bootstrapTools = import (if localSystem.libc == "musl" then ./bootstrap-tools-musl else ./bootstrap-tools) {
inherit system bootstrapFiles;
extraAttrs = lib.optionalAttrs
(config.contentAddressedByDefault or false)
config.contentAddressedByDefault
{
__contentAddressed = true;
outputHashAlgo = "sha256";

View File

@ -235,7 +235,7 @@ in with pkgs; rec {
bootstrapTools =
let extraAttrs = lib.optionalAttrs
(config.contentAddressedByDefault or false)
config.contentAddressedByDefault
{
__contentAddressed = true;
outputHashAlgo = "sha256";

View File

@ -36,6 +36,10 @@ let
feature = "set <literal>strictDeps</literal> to true by default";
};
contentAddressedByDefault = mkMassRebuild {
feature = "set <literal>__contentAddressed</literal> to true by default";
};
allowAliases = mkOption {
type = types.bool;
default = true;