diff options
Diffstat (limited to 'pkgs/stdenv')
-rw-r--r-- | pkgs/stdenv/darwin/default.nix | 8 | ||||
-rw-r--r-- | pkgs/stdenv/freebsd/default.nix | 8 | ||||
-rw-r--r-- | pkgs/stdenv/generic/default.nix | 5 | ||||
-rw-r--r-- | pkgs/stdenv/linux/bootstrap-tools-musl/default.nix | 6 | ||||
-rw-r--r-- | pkgs/stdenv/linux/bootstrap-tools/default.nix | 6 | ||||
-rw-r--r-- | pkgs/stdenv/linux/default.nix | 11 | ||||
-rw-r--r-- | pkgs/stdenv/linux/make-bootstrap-tools.nix | 15 |
7 files changed, 45 insertions, 14 deletions
diff --git a/pkgs/stdenv/darwin/default.nix b/pkgs/stdenv/darwin/default.nix index e8b3ef6c10fd4..227f53b02ccf3 100644 --- a/pkgs/stdenv/darwin/default.nix +++ b/pkgs/stdenv/darwin/default.nix @@ -40,7 +40,7 @@ in rec { stripAllFlags=" " # the Darwin "strip" command doesn't know "-s" ''; - bootstrapTools = derivation { + bootstrapTools = derivation ({ inherit system; name = "bootstrap-tools"; @@ -50,7 +50,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: {}), diff --git a/pkgs/stdenv/freebsd/default.nix b/pkgs/stdenv/freebsd/default.nix index 9a890532b790f..ddcdc6a66e087 100644 --- a/pkgs/stdenv/freebsd/default.nix +++ b/pkgs/stdenv/freebsd/default.nix @@ -170,7 +170,7 @@ in ({}: { __raw = true; - bootstrapTools = derivation { + bootstrapTools = derivation ({ inherit system; inherit make bash coreutils findutils diffutils grep patch gawk cpio sed @@ -182,7 +182,11 @@ in buildInputs = [ make ]; mkdir = "/bin/mkdir"; ln = "/bin/ln"; - }; + } // lib.optionalAttrs (config.contentAddressedByDefault or false) { + __contentAddressed = true; + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + }); }) ({ bootstrapTools, ... }: rec { diff --git a/pkgs/stdenv/generic/default.nix b/pkgs/stdenv/generic/default.nix index cb2b2bc51e9c9..4cfdb6e4c17d5 100644 --- a/pkgs/stdenv/generic/default.nix +++ b/pkgs/stdenv/generic/default.nix @@ -84,6 +84,11 @@ let allowedRequisites = allowedRequisites ++ defaultNativeBuildInputs ++ defaultBuildInputs; } + // lib.optionalAttrs (config.contentAddressedByDefault or false) { + __contentAddressed = true; + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + } // { inherit name; diff --git a/pkgs/stdenv/linux/bootstrap-tools-musl/default.nix b/pkgs/stdenv/linux/bootstrap-tools-musl/default.nix index 6118585d545f9..d690f40267217 100644 --- a/pkgs/stdenv/linux/bootstrap-tools-musl/default.nix +++ b/pkgs/stdenv/linux/bootstrap-tools-musl/default.nix @@ -1,6 +1,6 @@ -{ system, bootstrapFiles }: +{ system, bootstrapFiles, extraAttrs }: -derivation { +derivation ({ name = "bootstrap-tools"; builder = bootstrapFiles.busybox; @@ -15,4 +15,4 @@ derivation { langC = true; langCC = true; isGNU = true; -} +} // extraAttrs) diff --git a/pkgs/stdenv/linux/bootstrap-tools/default.nix b/pkgs/stdenv/linux/bootstrap-tools/default.nix index 6118585d545f9..d690f40267217 100644 --- a/pkgs/stdenv/linux/bootstrap-tools/default.nix +++ b/pkgs/stdenv/linux/bootstrap-tools/default.nix @@ -1,6 +1,6 @@ -{ system, bootstrapFiles }: +{ system, bootstrapFiles, extraAttrs }: -derivation { +derivation ({ name = "bootstrap-tools"; builder = bootstrapFiles.busybox; @@ -15,4 +15,4 @@ derivation { langC = true; langCC = true; isGNU = true; -} +} // extraAttrs) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index 13003a449860e..816f0865fa759 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -61,7 +61,16 @@ let # Download and unpack the bootstrap tools (coreutils, GCC, Glibc, ...). - bootstrapTools = import (if localSystem.libc == "musl" then ./bootstrap-tools-musl else ./bootstrap-tools) { inherit system bootstrapFiles; }; + bootstrapTools = import (if localSystem.libc == "musl" then ./bootstrap-tools-musl else ./bootstrap-tools) { + inherit system bootstrapFiles; + extraAttrs = lib.optionalAttrs + (config.contentAddressedByDefault or false) + { + __contentAddressed = true; + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + }; + }; getLibc = stage: stage.${localSystem.libc}; diff --git a/pkgs/stdenv/linux/make-bootstrap-tools.nix b/pkgs/stdenv/linux/make-bootstrap-tools.nix index e4db92b7717c2..4db40a2e516b2 100644 --- a/pkgs/stdenv/linux/make-bootstrap-tools.nix +++ b/pkgs/stdenv/linux/make-bootstrap-tools.nix @@ -224,15 +224,24 @@ in with pkgs; rec { bootstrapTools = runCommand "bootstrap-tools.tar.xz" {} "cp ${build}/on-server/bootstrap-tools.tar.xz $out"; }; - bootstrapTools = if (stdenv.hostPlatform.libc == "glibc") then + bootstrapTools = + let extraAttrs = lib.optionalAttrs + (config.contentAddressedByDefault or false) + { + __contentAddressed = true; + outputHashAlgo = "sha256"; + outputHashMode = "recursive"; + }; + in + if (stdenv.hostPlatform.libc == "glibc") then import ./bootstrap-tools { inherit (stdenv.buildPlatform) system; # Used to determine where to build - inherit bootstrapFiles; + inherit bootstrapFiles extraAttrs; } else if (stdenv.hostPlatform.libc == "musl") then import ./bootstrap-tools-musl { inherit (stdenv.buildPlatform) system; # Used to determine where to build - inherit bootstrapFiles; + inherit bootstrapFiles extraAttrs; } else throw "unsupported libc"; |