From 9a8b7640e010b901fb528cf62cf0bc79e0912ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselm=20Sch=C3=BCler?= Date: Sun, 3 Apr 2022 15:12:18 +0200 Subject: [PATCH 1/2] =?UTF-8?q?nixos/doc/types:=20note=20submodules?= =?UTF-8?q?=E2=80=99=20default=E2=80=99s=20behaviour?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nixos/doc/manual/development/option-types.section.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nixos/doc/manual/development/option-types.section.md b/nixos/doc/manual/development/option-types.section.md index 00f1d85bdb61..d32d4fc50ad7 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** From 8e68f3fcfc9eb2a00aae46bfb7f6f27a87f920f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anselm=20Sch=C3=BCler?= Date: Sun, 3 Apr 2022 16:44:09 +0200 Subject: [PATCH 2/2] nixos/doc: build manual --- .../doc/manual/from_md/development/option-types.section.xml | 6 ++++++ 1 file changed, 6 insertions(+) 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 444729292702..c67e183581c2 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 @@ (Example: Submodule defined as a 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. + Example: Directly defined