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: overlayFor = getStdenv: final: prev:
let currentStdenv = getStdenv final; in let
{ currentStdenv = getStdenv final;
nixStable = prev.nix; comDeps = with final; commonDeps {
nix =
with final;
with commonDeps {
inherit pkgs; inherit pkgs;
inherit (currentStdenv.hostPlatform) isStatic; 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; canRunInstalled = currentStdenv.buildPlatform.canExecute currentStdenv.hostPlatform;
in currentStdenv.mkDerivation (finalAttrs: { in currentStdenv.mkDerivation (finalAttrs: {
name = "nix-${version}"; name = "nix-${version}";
@ -412,13 +415,13 @@
outputs = [ "out" "dev" "doc" ]; outputs = [ "out" "dev" "doc" ];
nativeBuildInputs = nativeBuildDeps; nativeBuildInputs = comDeps.nativeBuildDeps;
buildInputs = buildDeps buildInputs = comDeps.buildDeps
# There have been issues building these dependencies # There have been issues building these dependencies
++ lib.optionals (currentStdenv.hostPlatform == currentStdenv.buildPlatform) awsDeps ++ lib.optionals (currentStdenv.hostPlatform == currentStdenv.buildPlatform) comDeps.awsDeps
++ lib.optionals finalAttrs.doCheck checkDeps; ++ lib.optionals finalAttrs.doCheck comDeps.checkDeps;
propagatedBuildInputs = propagatedDeps; propagatedBuildInputs = comDeps.propagatedDeps;
disallowedReferences = [ boost ]; disallowedReferences = [ boost ];
@ -443,11 +446,11 @@
''} ''}
''; '';
configureFlags = configureFlags ++ configureFlags = comDeps.configureFlags ++
[ "--sysconfdir=/etc" ] ++ [ "--sysconfdir=/etc" ] ++
lib.optional stdenv.hostPlatform.isStatic "--enable-embedded-sandbox-shell" ++ lib.optional stdenv.hostPlatform.isStatic "--enable-embedded-sandbox-shell" ++
[ (lib.enableFeature finalAttrs.doCheck "tests") ] ++ [ (lib.enableFeature finalAttrs.doCheck "tests") ] ++
lib.optionals finalAttrs.doCheck testConfigureFlags ++ lib.optionals finalAttrs.doCheck comDeps.testConfigureFlags ++
lib.optional (!canRunInstalled) "--disable-doc-gen"; lib.optional (!canRunInstalled) "--disable-doc-gen";
enableParallelBuilding = true; enableParallelBuilding = true;