2022-09-30 11:47:45 +00:00
|
|
|
{ config, lib, moduleType, hostPkgs, ... }:
|
|
|
|
let
|
2024-04-21 15:54:59 +00:00
|
|
|
inherit (lib) mkOption types;
|
2022-09-30 11:47:45 +00:00
|
|
|
in
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
interactive = mkOption {
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2022-09-30 11:47:45 +00:00
|
|
|
Tests [can be run interactively](#sec-running-nixos-tests-interactively)
|
|
|
|
using the program in the test derivation's `.driverInteractive` attribute.
|
|
|
|
|
|
|
|
When they are, the configuration will include anything set in this submodule.
|
|
|
|
|
|
|
|
You can set any top-level test option here.
|
|
|
|
|
|
|
|
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).
|
|
|
|
'';
|
|
|
|
type = moduleType;
|
|
|
|
visible = "shallow";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config = {
|
|
|
|
interactive.qemu.package = hostPkgs.qemu;
|
|
|
|
interactive.extraDriverArgs = [ "--interactive" ];
|
|
|
|
passthru.driverInteractive = config.interactive.driver;
|
|
|
|
};
|
|
|
|
}
|