overlayFor: factor out with final; with commonDeps;

Change-Id: I01bfc2cb6b7893a4440f3463d20032cf39ce9f88
This commit is contained in:
Qyriad 2024-03-01 13:30:50 -07:00
parent e104f37145
commit 69dfddd8b3

View file

@ -391,17 +391,20 @@
'';
overlayFor = getStdenv: final: prev:
let currentStdenv = getStdenv final; in
{
nixStable = prev.nix;
nix =
with final;
with commonDeps {
let
currentStdenv = getStdenv final;
comDeps = with final; commonDeps {
inherit pkgs;
inherit (currentStdenv.hostPlatform) isStatic;
};
let
inherit (final) stdenv boost;
in {
nixStable = prev.nix;
# Forward from the previous stage as we dont want it to pick the lowdown override
nixUnstable = prev.nixUnstable;
nix = let
canRunInstalled = currentStdenv.buildPlatform.canExecute currentStdenv.hostPlatform;
in currentStdenv.mkDerivation (finalAttrs: {
name = "nix-${version}";
@ -412,13 +415,13 @@
outputs = [ "out" "dev" "doc" ];
nativeBuildInputs = nativeBuildDeps;
buildInputs = buildDeps
nativeBuildInputs = comDeps.nativeBuildDeps;
buildInputs = comDeps.buildDeps
# There have been issues building these dependencies
++ lib.optionals (currentStdenv.hostPlatform == currentStdenv.buildPlatform) awsDeps
++ lib.optionals finalAttrs.doCheck checkDeps;
++ lib.optionals (currentStdenv.hostPlatform == currentStdenv.buildPlatform) comDeps.awsDeps
++ lib.optionals finalAttrs.doCheck comDeps.checkDeps;
propagatedBuildInputs = propagatedDeps;
propagatedBuildInputs = comDeps.propagatedDeps;
disallowedReferences = [ boost ];
@ -443,11 +446,11 @@
''}
'';
configureFlags = configureFlags ++
configureFlags = comDeps.configureFlags ++
[ "--sysconfdir=/etc" ] ++
lib.optional stdenv.hostPlatform.isStatic "--enable-embedded-sandbox-shell" ++
[ (lib.enableFeature finalAttrs.doCheck "tests") ] ++
lib.optionals finalAttrs.doCheck testConfigureFlags ++
lib.optionals finalAttrs.doCheck comDeps.testConfigureFlags ++
lib.optional (!canRunInstalled) "--disable-doc-gen";
enableParallelBuilding = true;