NixOS:Properties: Difference between revisions
imported>Fadenb Created page with "Properties are used to scope option definitions with control flow statements which do not break (example) the highly recursive..." |
imported>Fricklerhandwerk add category: NixOS |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 3: | Line 3: | ||
* <code>mkNotdef</code>: Invalidate a definition. Any attribute which has this value is considered as not defined in the current module. | * <code>mkNotdef</code>: Invalidate a definition. Any attribute which has this value is considered as not defined in the current module. | ||
* <code>mkIf condition definitions</code>: Create a conditional statements around multiple definitions. The definitions are considered only if the condition is verified. | * <code>mkIf condition definitions</code>: Create a conditional statements around multiple definitions. The definitions are considered only if the condition is verified. | ||
* <code>mkOverrideTemplate priority template definitions</code>: Set a priority level to all definitions which are enumerated inside the template. Only definitions with the lower priority level are kept. The default priority level is 100. An empty template is considered as all definitions. | * <code>mkOverrideTemplate priority template definitions</code>: Set a priority level to all definitions which are enumerated inside the template. Only definitions with the lower priority level are kept. The default priority level is 100. An empty template is considered as all definitions. | ||
* <code>mkOverride priority template definitions</code>: Currently the same as <code>mkOverrideTemplate</code>. | * <code>mkOverride priority template definitions</code>: Currently the same as <code>mkOverrideTemplate</code>. | ||
* <code>mkDefaultValue definitions</code>: A shortcut notation to define default values (priority level of 1000) inside the configuration. This is extremely useful to avoid references to properties inside the user configuration while overriding the default value of the option. Any option define without this property will take precedence over it. | * <code>mkDefaultValue definitions</code>: A shortcut notation to define default values (priority level of 1000) inside the configuration. This is extremely useful to avoid references to properties inside the user configuration while overriding the default value of the option. Any option define without this property will take precedence over it. | ||
* <code>mkOrder rank definitions</code>: Add a rank value to definitions. This is useful for options where some dependences between definitions exist. A lower rank will add the definitions among the first definitions. The default rank is | * <code>mkOrder rank definitions</code>: Add a rank value to definitions. This is useful for options where some dependences between definitions exist. A lower rank will add the definitions among the first definitions. The default rank is 1000. | ||
[[Category:NixOS]] |
Latest revision as of 00:36, 11 August 2022
Properties are used to scope option definitions with control flow statements which do not break (example) the highly recursive process of merging modules. All properties are defined in lib/modules.nix
.
mkNotdef
: Invalidate a definition. Any attribute which has this value is considered as not defined in the current module.mkIf condition definitions
: Create a conditional statements around multiple definitions. The definitions are considered only if the condition is verified.mkOverrideTemplate priority template definitions
: Set a priority level to all definitions which are enumerated inside the template. Only definitions with the lower priority level are kept. The default priority level is 100. An empty template is considered as all definitions.mkOverride priority template definitions
: Currently the same asmkOverrideTemplate
.mkDefaultValue definitions
: A shortcut notation to define default values (priority level of 1000) inside the configuration. This is extremely useful to avoid references to properties inside the user configuration while overriding the default value of the option. Any option define without this property will take precedence over it.mkOrder rank definitions
: Add a rank value to definitions. This is useful for options where some dependences between definitions exist. A lower rank will add the definitions among the first definitions. The default rank is 1000.