1{ lib, ... }:
2let
3 inherit (lib) types mkOption mdDoc;
4in
5{
6 options = {
7 meta = lib.mkOption {
8 description = mdDoc ''
9 The [`meta`](https://nixos.org/manual/nixpkgs/stable/#chap-meta) attributes that will be set on the returned derivations.
10
11 Not all [`meta`](https://nixos.org/manual/nixpkgs/stable/#chap-meta) attributes are supported, but more can be added as desired.
12 '';
13 apply = lib.filterAttrs (k: v: v != null);
14 type = types.submodule {
15 options = {
16 maintainers = lib.mkOption {
17 type = types.listOf types.raw;
18 default = [];
19 description = mdDoc ''
20 The [list of maintainers](https://nixos.org/manual/nixpkgs/stable/#var-meta-maintainers) for this test.
21 '';
22 };
23 timeout = lib.mkOption {
24 type = types.nullOr types.int;
25 default = null; # NOTE: null values are filtered out by `meta`.
26 description = mdDoc ''
27 The [{option}`test`](#test-opt-test)'s [`meta.timeout`](https://nixos.org/manual/nixpkgs/stable/#var-meta-timeout) in seconds.
28 '';
29 };
30 broken = lib.mkOption {
31 type = types.bool;
32 default = false;
33 description = mdDoc ''
34 Sets the [`meta.broken`](https://nixos.org/manual/nixpkgs/stable/#var-meta-broken) attribute on the [{option}`test`](#test-opt-test) derivation.
35 '';
36 };
37 };
38 };
39 default = {};
40 };
41 };
42}