+1
lib/default.nix
+1
lib/default.nix
+16
-4
lib/modules.nix
+16
-4
lib/modules.nix
···-}) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))+) (addErrorContext "while evaluating definitions from `${m.file}':" (dischargeProperties m.value))······
+8
lib/tests/modules.sh
+8
lib/tests/modules.sh
···checkConfigError 'In pathWith, inStore means the path must be absolute' config.impossiblePathOptionType ./pathWith.nix+checkConfigError 'Cannot merge definitions.*\n\s*- In .file.*\n\s*- In .other.*' config.conflict ./mkDefinition.nix+checkConfigError 'A definition for option .viaOptionDefault. is not of type .boolean.*' config.viaOptionDefault ./mkDefinition.nix
+71
lib/tests/modules/mkDefinition.nix
+71
lib/tests/modules/mkDefinition.nix
···
+62
nixos/doc/manual/development/option-def.section.md
+62
nixos/doc/manual/development/option-def.section.md
···+The module system internally transforms module syntax into definitions. This always happens internally.+It is possible to create first class definitions which are not transformed _again_ into definitions by the module system.+However, when manipulating definitions, it may be useful for them to be completely self-contained (or "free-floating").+Preserving the file location creates better error messages, for example when copying definitions from one option to another.+Other properties like `mkOverride` `mkMerge` `mkAfter` can be used in the `value` attribute but not on the entire definition.+The following shows an example configuration that yields an error with the custom position information:+To set the file location for all definitions in a module, you may add the `_file` module syntax attribute, which has a similar effect to using `mkDefinition` on all definitions in the module, without the hassle.
+3
nixos/doc/manual/redirects.json
+3
nixos/doc/manual/redirects.json
···