···9595A portion of the configuration tree which is elided from `config`.
96969797<!-- TODO: when markdown migration is complete, make _module docs visible again and reference _module docs. Maybe move those docs into this chapter? -->
9898+9999+#### `_type` {#module-system-lib-evalModules-return-value-_type}
100100+101101+A nominal type marker, always `"configuration"`.
102102+103103+#### `configurationClass` {#module-system-lib-evalModules-return-value-_configurationClass}
104104+105105+Equal to the [`class` parameter](#module-system-lib-evalModules-param-class).
+1-11
lib/modules.nix
···220220 within a configuration, but can be used in module imports.
221221 '';
222222 };
223223-224224- _module.class = mkOption {
225225- readOnly = true;
226226- internal = true;
227227- description = lib.mdDoc ''
228228- If the `class` attribute is set and non-`null`, the module system will reject `imports` with a different `class`.
229229-230230- This option contains the expected `class` attribute of the current module evaluation.
231231- '';
232232- };
233223 };
234224235225 config = {
···237227 inherit extendModules;
238228 moduleType = type;
239229 };
240240- _module.class = class;
241230 _module.specialArgs = specialArgs;
242231 };
243232 };
···337326 config = checked (removeAttrs config [ "_module" ]);
338327 _module = checked (config._module);
339328 inherit extendModules type;
329329+ configurationClass = class;
340330 };
341331 in result;
342332
+1
lib/tests/modules.sh
···364364365365# Class checks, evalModules
366366checkConfigOutput '^{ }$' config.ok.config ./class-check.nix
367367+checkConfigOutput '"nixos"' config.ok.configurationClass ./class-check.nix
367368checkConfigError 'The module .*/module-class-is-darwin.nix was imported into nixos instead of darwin.' config.fail.config ./class-check.nix
368369checkConfigError 'The module foo.nix#darwinModules.default was imported into nixos instead of darwin.' config.fail-anon.config ./class-check.nix
369370