![adisbladis](/assets/img/avatar_default.png)
This will respect `recurseForDerivations` when iterating over attrsets. Example expression: ``` nix { system ? builtins.currentSystem }: { recurseForDerivations = true; # This should build as it's in the top-level attrset drvA = derivation { inherit system; name = "drvA"; builder = ":"; }; dontRecurse = { # This shouldn't build as `recurseForDerivations = true;` is not set # recurseForDerivations = true; # This should not build drvB = derivation { inherit system; name = "drvA"; builder = ":"; }; }; recurse = { # This should build recurseForDerivations = true; # This should not build drvC = derivation { inherit system; name = "drvC"; builder = ":"; }; }; } ```
35 lines
639 B
Nix
35 lines
639 B
Nix
{
|
|
pkgs ? import (builtins.getFlake (toString ./.)).inputs.nixpkgs { }
|
|
, system ? pkgs.system
|
|
}:
|
|
|
|
{
|
|
builtJob = pkgs.writeText "job1" "job1";
|
|
substitutedJob = pkgs.hello;
|
|
|
|
dontRecurse = {
|
|
# This shouldn't build as `recurseForDerivations = true;` is not set
|
|
# recurseForDerivations = true;
|
|
|
|
# This should not build
|
|
drvB = derivation {
|
|
inherit system;
|
|
name = "drvA";
|
|
builder = ":";
|
|
};
|
|
};
|
|
|
|
recurse = {
|
|
# This should build
|
|
recurseForDerivations = true;
|
|
|
|
# This should not build
|
|
drvB = derivation {
|
|
inherit system;
|
|
name = "drvB";
|
|
builder = ":";
|
|
};
|
|
};
|
|
|
|
}
|