ci/eval: add extraNixpkgsConfig argument (#457204)

This commit is contained in:
Gaétan Lepage
2025-10-31 23:44:10 +00:00
committed by GitHub
4 changed files with 13 additions and 1 deletions

View File

@@ -18,6 +18,7 @@
lib ? import (path + "/lib"), lib ? import (path + "/lib"),
trace ? false, trace ? false,
path ? ./../.., path ? ./../..,
extraNixpkgsConfigJson ? "{}",
}: }:
let let
@@ -46,6 +47,7 @@ let
outpaths = import ./outpaths.nix { outpaths = import ./outpaths.nix {
inherit path; inherit path;
extraNixpkgsConfig = builtins.fromJSON extraNixpkgsConfigJson;
attrNamesOnly = true; attrNamesOnly = true;
}; };

View File

@@ -8,6 +8,7 @@
myChunk, myChunk,
includeBroken, includeBroken,
systems, systems,
extraNixpkgsConfigJson,
}: }:
let let
@@ -17,6 +18,7 @@ let
unfiltered = import ./outpaths.nix { unfiltered = import ./outpaths.nix {
inherit path; inherit path;
inherit includeBroken systems; inherit includeBroken systems;
extraNixpkgsConfig = builtins.fromJSON extraNixpkgsConfigJson;
}; };
# Turns the unfiltered recursive attribute set into one that is limited to myAttrpaths # Turns the unfiltered recursive attribute set into one that is limited to myAttrpaths

View File

@@ -26,6 +26,8 @@
quickTest ? false, quickTest ? false,
# Don't try to eval packages marked as broken. # Don't try to eval packages marked as broken.
includeBroken ? false, includeBroken ? false,
# Customize the config used to evaluate nixpkgs
extraNixpkgsConfig ? { },
}: }:
let let
@@ -75,6 +77,7 @@ let
"$src/ci/eval/attrpaths.nix" \ "$src/ci/eval/attrpaths.nix" \
-A paths \ -A paths \
-I "$src" \ -I "$src" \
--argstr extraNixpkgsConfigJson ${lib.escapeShellArg (builtins.toJSON extraNixpkgsConfig)} \
--option restrict-eval true \ --option restrict-eval true \
--option allow-import-from-derivation false \ --option allow-import-from-derivation false \
--option eval-system "${evalSystem}" > $out/paths.json --option eval-system "${evalSystem}" > $out/paths.json
@@ -120,6 +123,7 @@ let
--arg attrpathFile "${attrpathFile}" \ --arg attrpathFile "${attrpathFile}" \
--arg systems "[ \"$system\" ]" \ --arg systems "[ \"$system\" ]" \
--arg includeBroken ${lib.boolToString includeBroken} \ --arg includeBroken ${lib.boolToString includeBroken} \
--argstr extraNixpkgsConfigJson ${lib.escapeShellArg (builtins.toJSON extraNixpkgsConfig)} \
-I ${nixpkgs} \ -I ${nixpkgs} \
-I ${attrpathFile} \ -I ${attrpathFile} \
> "$outputDir/result/$myChunk" \ > "$outputDir/result/$myChunk" \

View File

@@ -11,6 +11,9 @@
# Set this to `null` to build for builtins.currentSystem only # Set this to `null` to build for builtins.currentSystem only
systems ? builtins.fromJSON (builtins.readFile ../supportedSystems.json), systems ? builtins.fromJSON (builtins.readFile ../supportedSystems.json),
# Customize the config used to evaluate nixpkgs
extraNixpkgsConfig ? { },
}: }:
let let
lib = import (path + "/lib"); lib = import (path + "/lib");
@@ -55,7 +58,8 @@ let
true; true;
inHydra = true; inHydra = true;
}; }
// extraNixpkgsConfig;
__allowFileset = false; __allowFileset = false;
}; };