lib.deferredModule: Make it properly singular

+19 -12
+1 -1
lib/tests/modules/deferred-module.nix
··· 12 12 ({ config, ... }: { 13 13 _file = "generic.nix"; 14 14 options.nodes = mkOption { 15 - type = lazyAttrsOf (submodule { imports = config.default; }); 15 + type = lazyAttrsOf (submodule { imports = [ config.default ]; }); 16 16 default = {}; 17 17 }; 18 18 options.default = mkOption {
+3 -1
lib/types.nix
··· 549 549 name = "deferredModule"; 550 550 description = "module"; 551 551 check = x: isAttrs x || isFunction x || path.check x; 552 - merge = loc: defs: staticModules ++ map (def: lib.setDefaultModuleLocation "${def.file}, via option ${showOption loc}" def.value) defs; 552 + merge = loc: defs: { 553 + imports = staticModules ++ map (def: lib.setDefaultModuleLocation "${def.file}, via option ${showOption loc}" def.value) defs; 554 + }; 553 555 inherit (submoduleWith { modules = staticModules; }) 554 556 getSubOptions 555 557 getSubModules;
+3 -2
nixos/doc/manual/development/option-types.section.md
··· 227 227 228 228 It can be set multiple times. 229 229 230 - Module authors can use its value, which is always a list of module values, 231 - in `imports` or in `submoduleWith`'s `modules` parameter. 230 + Module authors can use its value in `imports`, in `submoduleWith`'s `modules` 231 + or in `evalModules`' `modules` parameter, among other places. 232 + 232 233 Note that `imports` must be evaluated before the module fixpoint. Because 233 234 of this, deferred modules can only be imported into "other" fixpoints, such 234 235 as submodules.
+12 -8
nixos/doc/manual/from_md/development/option-types.section.xml
··· 441 441 It can be set multiple times. 442 442 </para> 443 443 <para> 444 - Module authors can use its value, which is always a list of 445 - module values, in <literal>imports</literal> or in 446 - <literal>submoduleWith</literal>’s 447 - <literal>modules</literal> parameter. Note that 448 - <literal>imports</literal> must be evaluated before the 449 - module fixpoint. Because of this, deferred modules can only 450 - be imported into <quote>other</quote> fixpoints, such as 451 - submodules. 444 + Module authors can use its value in 445 + <literal>imports</literal>, in 446 + <literal>submoduleWith</literal><quote>s 447 + <literal>modules</literal> or in 448 + <literal>evalModules</literal></quote> 449 + <literal>modules</literal> parameter, among other places. 450 + </para> 451 + <para> 452 + Note that <literal>imports</literal> must be evaluated 453 + before the module fixpoint. Because of this, deferred 454 + modules can only be imported into <quote>other</quote> 455 + fixpoints, such as submodules. 452 456 </para> 453 457 <para> 454 458 One use case for this type is the type of a