depot/third_party/nixpkgs/nixos/lib/testing/interactive.nix
Default email 5083ee08a2 Project import generated by Copybara.
GitOrigin-RevId: 10ecda252ce1b3b1d6403caeadbcc8f30d5ab796
2022-09-30 06:47:45 -05:00

45 lines
1.2 KiB
Nix

{ config, lib, moduleType, hostPkgs, ... }:
let
inherit (lib) mkOption types mdDoc;
in
{
options = {
interactive = mkOption {
description = mdDoc ''
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;
};
}