diff --git a/flake.nix b/flake.nix index 7d8ff0d8f..83d70d3e0 100644 --- a/flake.nix +++ b/flake.nix @@ -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 don’t 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;