1{ config, lib, moduleType, hostPkgs, ... }:
2let
3 inherit (lib) mkOption types;
4in
5{
6 options = {
7 interactive = mkOption {
8 description = ''
9 Tests [can be run interactively](#sec-running-nixos-tests-interactively)
10 using the program in the test derivation's `.driverInteractive` attribute.
11
12 When they are, the configuration will include anything set in this submodule.
13
14 You can set any top-level test option here.
15
16 Example test module:
17
18 ```nix
19 { config, lib, ... }: {
20
21 nodes.rabbitmq = {
22 services.rabbitmq.enable = true;
23 };
24
25 # When running interactively ...
26 interactive.nodes.rabbitmq = {
27 # ... enable the web ui.
28 services.rabbitmq.managementPlugin.enable = true;
29 };
30 }
31 ```
32
33 For details, see the section about [running tests interactively](#sec-running-nixos-tests-interactively).
34 '';
35 type = moduleType;
36 visible = "shallow";
37 };
38 };
39
40 config = {
41 interactive.qemu.package = hostPkgs.qemu;
42 interactive.extraDriverArgs = [ "--interactive" ];
43 passthru.driverInteractive = config.interactive.driver;
44 };
45}