diff --git a/nixos/doc/manual/development/option-types.xml b/nixos/doc/manual/development/option-types.xml
index b8e3ea774a7..7b86e518aaf 100644
--- a/nixos/doc/manual/development/option-types.xml
+++ b/nixos/doc/manual/development/option-types.xml
@@ -157,26 +157,26 @@
Submodule
- Submodule is a very powerful type that defines a set of sub-options that
- are handled like a separate module.
- It is especially interesting when used with composed types like
- attrsOf or listOf.
+ submodule is a very powerful type that defines a set
+ of sub-options that are handled like a separate module.
- The submodule type take a parameter o, that
- should be a set, or a function returning a set with an
- options key defining the sub-options.
- The option set can be defined directly () or as reference ().
+ It takes a parameter o, that should be a set,
+ or a function returning a set with an options key
+ defining the sub-options.
+ Submodule option definitions are type-checked accordingly to the
+ options declarations.
+ Of course, you can nest submodule option definitons for even higher
+ modularity.
- Submodule option definitions are type-checked accordingly to the options
- declarations. It is possible to declare submodule options inside a submodule
- sub-options for even higher modularity.
+ The option set can be defined directly
+ () or as reference
+ ().
Directly defined submodule
options.mod = mkOption {
description = "submodule example";
- type = with types; listOf (submodule {
+ type = with types; submodule {
options = {
foo = mkOption {
type = int;
@@ -185,10 +185,10 @@ options.mod = mkOption {
type = str;
};
};
- });
+ };
};
-Submodule defined as a
+Submodule defined as a
reference
let
@@ -205,16 +205,20 @@ let
in
options.mod = mkOption {
description = "submodule example";
- type = with types; listOf (submodule modOptions);
+ type = with types; submodule modOptions;
};
-Composed with listOf
-
- When composed with listOf, submodule allows multiple
- definitions of the submodule option set.
+ The submodule type is especially interesting when
+ used with composed types like attrsOf or
+ listOf.
+ When composed with listOf
+ (),
+ submodule allows multiple definitions of the submodule
+ option set ().
+
Declaration of a list
- of submodules
+ nof submodules
options.mod = mkOption {
description = "submodule example";
@@ -238,13 +242,11 @@ config.mod = [
{ foo = 2; bar = "two"; }
];
-
-
-
-Composed with attrsOf
-
- When composed with attrsOf, submodule allows multiple
- named definitions of the submodule option set.
+ When composed with attrsOf
+ (),
+ submodule allows multiple named definitions of the
+ submodule option set ().
+
Declaration of
attribute sets of submodules
@@ -269,7 +271,6 @@ options.mod = mkOption {
config.mod.one = { foo = 1; bar = "one"; };
config.mod.two = { foo = 2; bar = "two"; };
-