2021-05-13 17:27:08 -04:00
|
|
|
{
|
2022-04-02 12:40:35 -07:00
|
|
|
lib,
|
|
|
|
|
config,
|
|
|
|
|
pkgs,
|
|
|
|
|
...
|
|
|
|
|
}:
|
|
|
|
|
with lib; let
|
|
|
|
|
cfg = config.test;
|
|
|
|
|
in {
|
2019-02-12 16:22:18 +01:00
|
|
|
options.test = {
|
|
|
|
|
name = mkOption {
|
|
|
|
|
description = "Test name";
|
|
|
|
|
type = types.str;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
description = mkOption {
|
|
|
|
|
description = "Test description";
|
|
|
|
|
type = types.str;
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-13 17:03:27 +01:00
|
|
|
enable = mkOption {
|
|
|
|
|
description = "Whether to enable test";
|
|
|
|
|
type = types.bool;
|
|
|
|
|
default = true;
|
|
|
|
|
};
|
|
|
|
|
|
2019-02-12 16:22:18 +01:00
|
|
|
assertions = mkOption {
|
|
|
|
|
type = types.listOf (types.submodule {
|
|
|
|
|
options = {
|
|
|
|
|
assertion = mkOption {
|
|
|
|
|
description = "assertion value";
|
|
|
|
|
type = types.bool;
|
|
|
|
|
default = false;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
message = mkOption {
|
|
|
|
|
description = "assertion message";
|
|
|
|
|
type = types.str;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
});
|
2022-04-02 12:40:35 -07:00
|
|
|
default = [];
|
|
|
|
|
example = [
|
|
|
|
|
{
|
|
|
|
|
assertion = false;
|
|
|
|
|
message = "you can't enable this for some reason";
|
|
|
|
|
}
|
|
|
|
|
];
|
2019-02-12 16:22:18 +01:00
|
|
|
description = ''
|
|
|
|
|
This option allows modules to express conditions that must
|
|
|
|
|
hold for the evaluation of the system configuration to
|
|
|
|
|
succeed, along with associated error messages for the user.
|
|
|
|
|
'';
|
|
|
|
|
};
|
2019-02-20 09:34:15 +01:00
|
|
|
|
2020-04-05 21:25:34 +07:00
|
|
|
script = mkOption {
|
|
|
|
|
description = "Test script to use for e2e test";
|
|
|
|
|
type = types.nullOr (types.either types.lines types.path);
|
2021-05-10 14:59:04 -04:00
|
|
|
default = null;
|
2019-02-20 09:34:15 +01:00
|
|
|
};
|
2019-02-12 16:22:18 +01:00
|
|
|
};
|
|
|
|
|
}
|