@@ -1,4 +1,4 @@
1−{ config, lib, pkgs, modules, baseModules, specialArgs, ... }:
1+{ config, lib, pkgs, extendModules, noUserModules, ... }:
22
33with lib;
44
@@ -11,16 +11,10 @@ let
1111 # you can provide an easy way to boot the same configuration
1212 # as you use, but with another kernel
1313 # !!! fix this
14− children = mapAttrs (childName: childConfig:
15− (import ../../../lib/eval-config.nix {
16− inherit lib baseModules specialArgs;
17− system = config.nixpkgs.initialSystem;
18− modules =
19− (optionals childConfig.inheritParentConfig modules)
20− ++ [ ./no-clone.nix ]
21− ++ [ childConfig.configuration ];
22− }).config.system.build.toplevel
23− ) config.specialisation;
14+ children =
15+ mapAttrs
16+ (childName: childConfig: childConfig.configuration.system.build.toplevel)
17+ config.specialisation;
2418
2519 systemBuilder =
2620 let
@@ -169,7 +163,11 @@ in
169163 </screen>
170164 '';
171165 type = types.attrsOf (types.submodule (
172− { ... }: {
166+ local@{ ... }: let
167+ extend = if local.config.inheritParentConfig
168+ then extendModules
169+ else noUserModules.extendModules;
170+ in {
173171 options.inheritParentConfig = mkOption {
174172 type = types.bool;
175173 default = true;
@@ -178,7 +176,15 @@ in
178176
179177 options.configuration = mkOption {
180178 default = {};
181− description = "Arbitrary NixOS configuration options.";
179+ description = ''
180+ Arbitrary NixOS configuration.
181+
182+ Anything you can add to a normal NixOS configuration, you can add
183+ here, including imports and config values, although nested
184+ specialisations will be ignored.
185+ '';
186+ visible = "shallow";
187+ inherit (extend { modules = [ ./no-clone.nix ]; }) type;
182188 };
183189 })
184190 );