about summary refs log tree commit diff
path: root/nixpkgs/nixos/lib/testing/meta.nix
blob: 805b7520edff342a56b867c312a5b454f37b6e55 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ lib, ... }:
let
  inherit (lib) types mkOption mdDoc;
in
{
  options = {
    meta = lib.mkOption {
      description = mdDoc ''
        The [`meta`](https://nixos.org/manual/nixpkgs/stable/#chap-meta) attributes that will be set on the returned derivations.

        Not all [`meta`](https://nixos.org/manual/nixpkgs/stable/#chap-meta) attributes are supported, but more can be added as desired.
      '';
      apply = lib.filterAttrs (k: v: v != null);
      type = types.submodule {
        options = {
          maintainers = lib.mkOption {
            type = types.listOf types.raw;
            default = [];
            description = mdDoc ''
              The [list of maintainers](https://nixos.org/manual/nixpkgs/stable/#var-meta-maintainers) for this test.
            '';
          };
          timeout = lib.mkOption {
            type = types.nullOr types.int;
            default = 3600;  # 1 hour
            description = mdDoc ''
              The [{option}`test`](#test-opt-test)'s [`meta.timeout`](https://nixos.org/manual/nixpkgs/stable/#var-meta-timeout) in seconds.
            '';
          };
          broken = lib.mkOption {
            type = types.bool;
            default = false;
            description = mdDoc ''
              Sets the [`meta.broken`](https://nixos.org/manual/nixpkgs/stable/#var-meta-broken) attribute on the [{option}`test`](#test-opt-test) derivation.
            '';
          };
        };
      };
      default = {};
    };
  };
}