From a11133507a930dfd235324cdf776bdb5e6ddd717 Mon Sep 17 00:00:00 2001 From: Matt Sturgeon Date: Tue, 8 Jul 2025 14:46:19 +0100 Subject: [PATCH] flake/ci: fix lazy eval of dev partition If the `ci` options are a set of options rather than a single option, then the module system cannot lazily override it via `mkForce`. In practice, this means that the dev partition gets evaluated strictly when the module system "pushes down" the `ci` definitions to its options. Instead, we must ensure that each attribute listed in `partitionedAttrs` corresponds to an actual option which can be directly defined, with no "pushing down" required. Fixes #3532 (cherry picked from commit 67785f957724771c7e6ce5a1654366580678c885) --- flake/ci.nix | 46 ++++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/flake/ci.nix b/flake/ci.nix index 69153c69..247dea66 100644 --- a/flake/ci.nix +++ b/flake/ci.nix @@ -4,38 +4,40 @@ let mapAttrs types ; - - buildbotOpt = lib.mkOption { - type = types.lazyAttrsOf types.package; - default = { }; - description = '' - A set of tests for [buildbot] to run. - - [buildbot]: https://buildbot.nix-community.org - ''; - }; in { perSystem = { - # Declare per-system CI options + # per-system CI options options.ci = { - buildbot = buildbotOpt; + buildbot = lib.mkOption { + type = types.lazyAttrsOf types.raw; + default = { }; + description = '' + A set of tests for [buildbot] to run. + + [buildbot]: https://buildbot.nix-community.org + ''; + }; }; }; flake = { - # Declare top-level CI options - options.ci = { - buildbot = lib.mkOption { - type = types.lazyAttrsOf buildbotOpt.type; - default = { }; - description = '' - See `perSystem.ci.buildbot` for description and examples. - ''; - }; + # top-level CI option + # + # NOTE: + # This must be an actual option, NOT a set of options. + # Otherwise, flake partitions will not be lazy. + options.ci = lib.mkOption { + type = types.lazyAttrsOf (types.lazyAttrsOf types.raw); + default = { }; + description = '' + Outputs related to CI. + + Usually defined via the `perSystem.ci` options. + ''; }; - # Transpose per-system CI outputs to the top-level + # Transpose per-system definitions to the top-level config.ci = { buildbot = mapAttrs (_: sysCfg: sysCfg.ci.buildbot) config.allSystems; };