diff --git a/nixos/doc/manual/default.nix b/nixos/doc/manual/default.nix index ecd62eb4e848..6db20cdd6418 100644 --- a/nixos/doc/manual/default.nix +++ b/nixos/doc/manual/default.nix @@ -63,6 +63,7 @@ let }; documentType = "none"; variablelistId = "test-options-list"; + optionIdPrefix = "test-opt-"; }; sources = lib.sourceFilesBySuffices ./. [".xml"]; diff --git a/nixos/doc/manual/development/running-nixos-tests-interactively.section.md b/nixos/doc/manual/development/running-nixos-tests-interactively.section.md index d9c316f4b139..1130672cb376 100644 --- a/nixos/doc/manual/development/running-nixos-tests-interactively.section.md +++ b/nixos/doc/manual/development/running-nixos-tests-interactively.section.md @@ -39,11 +39,11 @@ directory. ## Interactive-only test configuration {#sec-nixos-test-interactive-configuration} The `.driverInteractive` attribute combines the regular test configuration with -definitions from the [`interactive` submodule](#opt-interactive). This gives you +definitions from the [`interactive` submodule](#test-opt-interactive). This gives you a more usable, graphical, but slightly different configuration. You can add your own interactive-only test configuration by adding extra -configuration to the [`interactive` submodule](#opt-interactive). +configuration to the [`interactive` submodule](#test-opt-interactive). To interactively run only the regular configuration, build the `.driver` attribute instead, and call it with the flag `result/bin/nixos-test-driver --interactive`. diff --git a/nixos/doc/manual/development/writing-nixos-tests.section.md b/nixos/doc/manual/development/writing-nixos-tests.section.md index 99704ec3c141..2efe52b9883c 100644 --- a/nixos/doc/manual/development/writing-nixos-tests.section.md +++ b/nixos/doc/manual/development/writing-nixos-tests.section.md @@ -22,12 +22,12 @@ A NixOS test is a module that has the following structure: ``` We refer to the whole test above as a test module, whereas the values -in [`nodes.`](#opt-nodes) are NixOS modules themselves. +in [`nodes.`](#test-opt-nodes) are NixOS modules themselves. -The option [`testScript`](#opt-testScript) is a piece of Python code that executes the +The option [`testScript`](#test-opt-testScript) is a piece of Python code that executes the test (described below). During the test, it will start one or more virtual machines, the configuration of which is described by -the option [`nodes`](#opt-nodes). +the option [`nodes`](#test-opt-nodes). An example of a single-node test is [`login.nix`](https://github.com/NixOS/nixpkgs/blob/master/nixos/tests/login.nix). @@ -171,7 +171,7 @@ The following methods are available on machine objects: least one will be returned. ::: {.note} - This requires [`enableOCR`](#opt-enableOCR) to be set to `true`. + This requires [`enableOCR`](#test-opt-enableOCR) to be set to `true`. ::: `get_screen_text` @@ -180,7 +180,7 @@ The following methods are available on machine objects: machine\'s screen using optical character recognition. ::: {.note} - This requires [`enableOCR`](#opt-enableOCR) to be set to `true`. + This requires [`enableOCR`](#test-opt-enableOCR) to be set to `true`. ::: `send_monitor_command` @@ -291,7 +291,7 @@ The following methods are available on machine objects: `get_screen_text` and `get_screen_text_variants`). ::: {.note} - This requires [`enableOCR`](#opt-enableOCR) to be set to `true`. + This requires [`enableOCR`](#test-opt-enableOCR) to be set to `true`. ::: `wait_for_console_text` diff --git a/nixos/doc/manual/from_md/development/running-nixos-tests-interactively.section.xml b/nixos/doc/manual/from_md/development/running-nixos-tests-interactively.section.xml index 35d9bbd1c1fe..16db709f8b91 100644 --- a/nixos/doc/manual/from_md/development/running-nixos-tests-interactively.section.xml +++ b/nixos/doc/manual/from_md/development/running-nixos-tests-interactively.section.xml @@ -44,14 +44,14 @@ $ ./result/bin/nixos-test-driver --keep-vm-state The .driverInteractive attribute combines the regular test configuration with definitions from the - interactive + interactive submodule. This gives you a more usable, graphical, but slightly different configuration. You can add your own interactive-only test configuration by adding extra configuration to the - interactive + interactive submodule. diff --git a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml index 32f5fdb77f50..4db196273dad 100644 --- a/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml +++ b/nixos/doc/manual/from_md/development/writing-nixos-tests.section.xml @@ -24,16 +24,16 @@ We refer to the whole test above as a test module, whereas the values in - nodes.<name> + nodes.<name> are NixOS modules themselves. The option - testScript + testScript is a piece of Python code that executes the test (described below). During the test, it will start one or more virtual machines, the configuration of which is described by the option - nodes. + nodes. An example of a single-node test is @@ -263,7 +263,7 @@ start_all() This requires - enableOCR + enableOCR to be set to true. @@ -281,7 +281,7 @@ start_all() This requires - enableOCR + enableOCR to be set to true. @@ -522,7 +522,7 @@ start_all() This requires - enableOCR + enableOCR to be set to true. diff --git a/nixos/lib/make-options-doc/default.nix b/nixos/lib/make-options-doc/default.nix index 43dbff0e68dd..6a1bb868c20d 100644 --- a/nixos/lib/make-options-doc/default.nix +++ b/nixos/lib/make-options-doc/default.nix @@ -26,6 +26,8 @@ # If you include more than one option list into a document, you need to # provide different ids. , variablelistId ? "configuration-variable-list" + # Strig to prefix to the option XML/HTML id attributes. +, optionIdPrefix ? "opt-" , revision ? "" # Specify revision for the options # a set of options the docs we are generating will be merged into, as if by recursiveUpdate. # used to split the options doc build into a static part (nixos/modules) and a dynamic part @@ -183,6 +185,7 @@ in rec { --stringparam documentType '${documentType}' \ --stringparam revision '${revision}' \ --stringparam variablelistId '${variablelistId}' \ + --stringparam optionIdPrefix '${optionIdPrefix}' \ -o intermediate.xml ${./options-to-docbook.xsl} sorted.xml ${pkgs.libxslt.bin}/bin/xsltproc \ -o "$out" ${./postprocess-option-descriptions.xsl} intermediate.xml diff --git a/nixos/lib/make-options-doc/options-to-docbook.xsl b/nixos/lib/make-options-doc/options-to-docbook.xsl index 978d5e2468a8..d5b921b1dedb 100644 --- a/nixos/lib/make-options-doc/options-to-docbook.xsl +++ b/nixos/lib/make-options-doc/options-to-docbook.xsl @@ -15,6 +15,7 @@ + @@ -36,7 +37,7 @@ .inheritParentConfig`](https://search.nixos.org/options?show=specialisation.%3Cname%3E.inheritParentConfig&from=0&size=50&sort=relevance&type=packages&query=specialisation). + NixOS configuration that, like [{option}`defaults`](#test-opt-defaults), is applied to all [{option}`nodes`](#test-opt-nodes) and can not be undone with [`specialisation..inheritParentConfig`](https://search.nixos.org/options?show=specialisation.%3Cname%3E.inheritParentConfig&from=0&size=50&sort=relevance&type=packages&query=specialisation). ''; type = types.deferredModule; default = { }; @@ -82,7 +82,7 @@ in type = types.bool; default = false; description = mdDoc '' - Enable to configure all [{option}`nodes`](#opt-nodes) to run with a minimal kernel. + Enable to configure all [{option}`nodes`](#test-opt-nodes) to run with a minimal kernel. ''; };