mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03:00
nixos/testing: Improve option docs
This commit is contained in:
parent
4ce93fbae8
commit
6205d37747
12 changed files with 141 additions and 46 deletions
|
@ -1,7 +1,7 @@
|
|||
testModuleArgs@{ config, lib, hostPkgs, nodes, ... }:
|
||||
|
||||
let
|
||||
inherit (lib) mkOption mkForce optional types mapAttrs mkDefault;
|
||||
inherit (lib) mkOption mkForce optional types mapAttrs mkDefault mdDoc;
|
||||
|
||||
system = hostPkgs.stdenv.hostPlatform.system;
|
||||
|
||||
|
@ -39,11 +39,29 @@ in
|
|||
|
||||
nodes = mkOption {
|
||||
type = types.lazyAttrsOf config.node.type;
|
||||
visible = "shallow";
|
||||
description = mdDoc ''
|
||||
An attribute set of NixOS configuration modules.
|
||||
|
||||
The configurations are augmented by the [`defaults`](#opt-defaults) option.
|
||||
|
||||
They are assigned network addresses according to the `nixos/lib/testing/network.nix` module.
|
||||
|
||||
A few special options are available, that aren't in a plain NixOS configuration. See [Configuring the nodes](#sec-nixos-test-nodes)
|
||||
'';
|
||||
};
|
||||
|
||||
defaults = mkOption {
|
||||
description = ''
|
||||
NixOS configuration that is applied to all {option}`nodes`.
|
||||
description = mdDoc ''
|
||||
NixOS configuration that is applied to all [{option}`nodes`](#opt-nodes).
|
||||
'';
|
||||
type = types.deferredModule;
|
||||
default = { };
|
||||
};
|
||||
|
||||
extraBaseModules = mkOption {
|
||||
description = mdDoc ''
|
||||
NixOS configuration that, like [{option}`defaults`](#opt-defaults), is applied to all [{option}`nodes`](#opt-nodes) and can not be undone with [`specialisation.<name>.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 = { };
|
||||
|
@ -52,15 +70,28 @@ in
|
|||
node.specialArgs = mkOption {
|
||||
type = types.lazyAttrsOf types.raw;
|
||||
default = { };
|
||||
description = mdDoc ''
|
||||
An attribute set of arbitrary values that will be made available as module arguments during the resolution of module `imports`.
|
||||
|
||||
Note that it is not possible to override these from within the NixOS configurations. If you argument is not relevant to `imports`, consider setting {option}`defaults._module.args.<name>` instead.
|
||||
'';
|
||||
};
|
||||
|
||||
minimal = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = mdDoc ''
|
||||
Enable to configure all [{option}`nodes`](#opt-nodes) to run with a minimal kernel.
|
||||
'';
|
||||
};
|
||||
|
||||
nodesCompat = mkOption {
|
||||
internal = true;
|
||||
description = mdDoc ''
|
||||
Basically `_module.args.nodes`, but with backcompat and warnings added.
|
||||
|
||||
This will go away.
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue