2020-09-27 10:43:20 +00:00
|
|
|
{ config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
{
|
2022-09-05 16:12:09 +00:00
|
|
|
imports = [
|
|
|
|
./shellcheck-services.nix
|
|
|
|
];
|
|
|
|
|
2020-09-27 10:43:20 +00:00
|
|
|
options = {
|
|
|
|
test = {
|
|
|
|
noConnections = mkOption {
|
|
|
|
type = types.bool;
|
2020-09-27 10:43:28 +00:00
|
|
|
default = !config.test.container.enableWAN;
|
2022-12-18 12:13:47 +00:00
|
|
|
description = mdDoc ''
|
2020-09-27 10:43:20 +00:00
|
|
|
Whether services should be configured to not connect to external hosts.
|
|
|
|
This can silence some warnings while running the test in an offline environment.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
data = mkOption {
|
|
|
|
type = types.attrs;
|
|
|
|
default = {};
|
2022-12-18 12:13:47 +00:00
|
|
|
description = mdDoc ''
|
2020-09-27 10:43:20 +00:00
|
|
|
Attrs that are available in the Python test script under the global
|
2022-12-18 12:13:47 +00:00
|
|
|
dictionary variable {var}`test_data`. The data is exported via JSON.
|
2020-09-27 10:43:20 +00:00
|
|
|
'';
|
|
|
|
};
|
2021-10-01 09:52:05 +00:00
|
|
|
extraTestScript = mkOption {
|
|
|
|
type = types.lines;
|
|
|
|
default = "";
|
|
|
|
description = "Extra lines added to the Python test script.";
|
|
|
|
};
|
2020-09-27 10:43:28 +00:00
|
|
|
container = {
|
|
|
|
# Forwarded to extra-container. For descriptions, see
|
|
|
|
# https://github.com/erikarvstedt/extra-container/blob/master/eval-config.nix
|
|
|
|
addressPrefix = mkOption { default = "10.225.255"; };
|
|
|
|
enableWAN = mkOption { default = false; };
|
|
|
|
firewallAllowHost = mkOption { default = true; };
|
|
|
|
exposeLocalhost = mkOption { default = false; };
|
|
|
|
};
|
2020-09-27 10:43:20 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
tests = mkOption {
|
|
|
|
type = with types; attrsOf bool;
|
|
|
|
default = {};
|
|
|
|
description = "Python tests that should be run.";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|