2022-06-06 12:29:04 +01:00
|
|
|
{ config, lib, moduleType, hostPkgs, ... }:
|
|
|
|
let
|
2022-06-27 19:06:30 +01:00
|
|
|
inherit (lib) mkOption types mdDoc;
|
2022-06-06 12:29:04 +01:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
interactive = mkOption {
|
2022-06-27 19:06:30 +01:00
|
|
|
description = mdDoc ''
|
2022-08-19 11:09:58 +01:00
|
|
|
Tests [can be run interactively](#sec-running-nixos-tests-interactively)
|
|
|
|
using the program in the test derivation's `.driverInteractive` attribute.
|
2022-06-27 19:06:30 +01:00
|
|
|
|
|
|
|
When they are, the configuration will include anything set in this submodule.
|
|
|
|
|
|
|
|
You can set any top-level test option here.
|
2022-08-19 11:09:58 +01:00
|
|
|
|
|
|
|
Example test module:
|
|
|
|
|
|
|
|
```nix
|
|
|
|
{ config, lib, ... }: {
|
|
|
|
|
|
|
|
nodes.rabbitmq = {
|
|
|
|
services.rabbitmq.enable = true;
|
|
|
|
};
|
|
|
|
|
|
|
|
# When running interactively ...
|
|
|
|
interactive.nodes.rabbitmq = {
|
|
|
|
# ... enable the web ui.
|
|
|
|
services.rabbitmq.managementPlugin.enable = true;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
For details, see the section about [running tests interactively](#sec-running-nixos-tests-interactively).
|
2022-06-27 19:06:30 +01:00
|
|
|
'';
|
2022-06-06 12:29:04 +01:00
|
|
|
type = moduleType;
|
2022-06-27 19:06:30 +01:00
|
|
|
visible = "shallow";
|
2022-06-06 12:29:04 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
|
|
|
interactive.qemu.package = hostPkgs.qemu;
|
|
|
|
interactive.extraDriverArgs = [ "--interactive" ];
|
|
|
|
passthru.driverInteractive = config.interactive.driver;
|
|
|
|
};
|
|
|
|
}
|