lib.deferredModule: Make it properly singular

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