2019-02-20 09:34:15 +01:00
|
|
|
{ lib, config, pkgs, ... }:
|
2019-02-12 16:22:18 +01:00
|
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
2019-02-20 09:34:15 +01:00
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
});
|
|
|
|
|
default = [];
|
|
|
|
|
example = [ { assertion = false; message = "you can't enable this for that reason"; } ];
|
|
|
|
|
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
|
|
|
|
|
|
|
|
extraCheckInputs = mkOption {
|
|
|
|
|
description = "Extra check inputs";
|
|
|
|
|
type = types.listOf types.package;
|
2019-10-06 21:42:19 +02:00
|
|
|
default = [];
|
2019-02-20 09:34:15 +01:00
|
|
|
};
|
|
|
|
|
|
2019-02-25 17:16:24 +01:00
|
|
|
testScript = mkOption {
|
|
|
|
|
description = "Script to run as part of testing";
|
2019-02-20 09:34:15 +01:00
|
|
|
type = types.nullOr types.lines;
|
|
|
|
|
default = null;
|
|
|
|
|
};
|
2019-02-25 17:16:24 +01:00
|
|
|
|
2020-01-28 16:37:02 -06:00
|
|
|
distro = mkOption {
|
|
|
|
|
description = "Kubernetes distro to run the test with. Defaults to 'nixos', other option is 'k3s'";
|
|
|
|
|
type = types.nullOr types.str;
|
|
|
|
|
default = null;
|
|
|
|
|
};
|
|
|
|
|
|
2019-03-11 20:49:33 +01:00
|
|
|
extraConfiguration = mkOption {
|
2019-02-25 17:16:24 +01:00
|
|
|
description = "Extra configuration for running test";
|
|
|
|
|
type = types.unspecified;
|
|
|
|
|
default = {};
|
|
|
|
|
};
|
2019-02-12 16:22:18 +01:00
|
|
|
};
|
|
|
|
|
}
|