+43
doc/module-system/module-system.chapter.md
+43
doc/module-system/module-system.chapter.md
···+2. Attributes from the [`specialArgs`] argument passed to [`evalModules`] or `submoduleWith`. These are application-specific.+3. Attributes from the `_module.args` option value. These are application-specific and can be provided by any module.+[`config`]{#module-system-module-argument-config} [๐](#module-system-module-argument-config)+Unlike the `evalModules` [`config` return attribute](#module-system-lib-evalModules-return-value-config), this includes `_module`.+[`options`]{#module-system-module-argument-options} [๐](#module-system-module-argument-options)+[`_class`]{#module-system-module-argument-_class} [๐](#module-system-module-argument-_class)+[`_prefix`]{#module-system-module-argument-_prefix} [๐](#module-system-module-argument-_prefix)+This is used to improve error reporting and to find the implicit `name` module argument in submodules.+It is exposed as a module argument due to how the module system is implemented, which cannot be avoided without breaking compatibility.+It is a good practice not to rely on `_prefix`. A module should not make assumptions about its location in the configuration tree.+For example, the root of a NixOS configuration may have a non-empty prefix, for example when it is a specialisation, or when it is part of a larger, multi-host configuration such as a [NixOS test](https://nixos.org/manual/nixos/unstable/#sec-nixos-tests).+Instead of depending on `_prefix` use explicit options, whose default definitions can be provided by the module that imports them.
+18
doc/redirects.json
+18
doc/redirects.json
···
+10
-3
lib/modules.nix
+10
-3
lib/modules.nix
·········+optionalString (prefix != [ ]) ", while trying to load a module into ${code (showOption prefix)}";···-Expected a module, but found a value of type ${warn (escapeNixString _type)}${into_fallback_file_maybe fallbackFile}.-A module is typically loaded by adding it the ${code "imports = [ ... ];"} attribute of an existing module, or in the ${code "modules = [ ... ];"} argument of various functions.+Expected a module, but found a value of type ${warn (escapeNixString _type)}${into_fallback_file_maybe fallbackFile}${into_prefix_maybe prefix}.+A module is typically loaded by adding it to the ${code "imports = [ ... ];"} attribute of an existing module, or in the ${code "modules = [ ... ];"} argument of various functions.Please make sure that each of the list items is a module, and not a different kind of value.···
+4
lib/tests/modules.sh
+4
lib/tests/modules.sh
······checkConfigOutput '^true$' config.enable ./declare-enable.nix ./define-enable-with-top-level-mkIf.nixcheckConfigError 'Expected a module, but found a value of type .*"configuration".*, while trying to load a module into .*/import-configuration.nix.' config ./import-configuration.nixcheckConfigError 'please only import the modules that make up the configuration' config ./import-configuration.nix+checkConfigError 'Expected a module, but found a value of type "configuration", while trying to load a module into .*/import-error-submodule.nix, while trying to load a module into .*foo.*\.' config.foo ./import-error-submodule.nix
+18
lib/tests/modules/import-error-submodule.nix
+18
lib/tests/modules/import-error-submodule.nix
···
+17
lib/tests/modules/prefix-module-argument.nix
+17
lib/tests/modules/prefix-module-argument.nix