diff options
author | pennae <82953136+pennae@users.noreply.github.com> | 2022-05-27 13:21:48 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-27 13:21:48 +0000 |
commit | f16c8e58cafdc97f8bcc360681bdb761309d005f (patch) | |
tree | 8c5e1706a8e50a1559c6dab8e0ffb8d40914415f | |
parent | 90b84a09b0196e0ef0355f4f343e92159bfe0716 (diff) | |
parent | 8e68f3fcfc9eb2a00aae46bfb7f6f27a87f920f0 (diff) |
Merge pull request #167037 from schuelermine/patch-doc-submodule-default
nixos/doc/types: note submodules’ default’s behaviour
-rw-r--r-- | nixos/doc/manual/development/option-types.section.md | 4 | ||||
-rw-r--r-- | nixos/doc/manual/from_md/development/option-types.section.xml | 6 |
2 files changed, 10 insertions, 0 deletions
diff --git a/nixos/doc/manual/development/option-types.section.md b/nixos/doc/manual/development/option-types.section.md index 00f1d85bdb615..d32d4fc50ad79 100644 --- a/nixos/doc/manual/development/option-types.section.md +++ b/nixos/doc/manual/development/option-types.section.md @@ -308,6 +308,10 @@ The option set can be defined directly ([Example: Directly defined submodule](#ex-submodule-direct)) or as reference ([Example: Submodule defined as a reference](#ex-submodule-reference)). +Note that even if your submodule’s options all have a default value, +you will still need to provide a default value (e.g. an empty attribute set) +if you want to allow users to leave it undefined. + ::: {#ex-submodule-direct .example} ::: {.title} **Example: Directly defined submodule** diff --git a/nixos/doc/manual/from_md/development/option-types.section.xml b/nixos/doc/manual/from_md/development/option-types.section.xml index 4447292927021..c67e183581c2c 100644 --- a/nixos/doc/manual/from_md/development/option-types.section.xml +++ b/nixos/doc/manual/from_md/development/option-types.section.xml @@ -617,6 +617,12 @@ (<link linkend="ex-submodule-reference">Example: Submodule defined as a reference</link>). </para> + <para> + Note that even if your submodule’s options all have a default + value, you will still need to provide a default value (e.g. an + empty attribute set) if you want to allow users to leave it + undefined. + </para> <anchor xml:id="ex-submodule-direct" /> <para> <emphasis role="strong">Example: Directly defined |