|
1 | 1 | { lib, ... }: |
2 | 2 | let |
3 | | - inherit (lib) types mkOption; |
| 3 | + inherit (lib) types mkOption literalMD; |
4 | 4 | in |
5 | 5 | { |
6 | 6 | options = { |
7 | | - meta = lib.mkOption { |
| 7 | + meta = mkOption { |
8 | 8 | description = '' |
9 | 9 | The [`meta`](https://nixos.org/manual/nixpkgs/stable/#chap-meta) attributes that will be set on the returned derivations. |
10 | 10 |
|
11 | 11 | Not all [`meta`](https://nixos.org/manual/nixpkgs/stable/#chap-meta) attributes are supported, but more can be added as desired. |
12 | 12 | ''; |
13 | 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 = '' |
20 | | - The [list of maintainers](https://nixos.org/manual/nixpkgs/stable/#var-meta-maintainers) for this test. |
21 | | - ''; |
| 14 | + type = types.submodule ( |
| 15 | + { config, ... }: |
| 16 | + { |
| 17 | + options = { |
| 18 | + maintainers = mkOption { |
| 19 | + type = types.listOf types.raw; |
| 20 | + default = [ ]; |
| 21 | + description = '' |
| 22 | + The [list of maintainers](https://nixos.org/manual/nixpkgs/stable/#var-meta-maintainers) for this test. |
| 23 | + ''; |
| 24 | + }; |
| 25 | + timeout = mkOption { |
| 26 | + type = types.nullOr types.int; |
| 27 | + default = 3600; # 1 hour |
| 28 | + description = '' |
| 29 | + The [{option}`test`](#test-opt-test)'s [`meta.timeout`](https://nixos.org/manual/nixpkgs/stable/#var-meta-timeout) in seconds. |
| 30 | + ''; |
| 31 | + }; |
| 32 | + broken = mkOption { |
| 33 | + type = types.bool; |
| 34 | + default = false; |
| 35 | + description = '' |
| 36 | + Sets the [`meta.broken`](https://nixos.org/manual/nixpkgs/stable/#var-meta-broken) attribute on the [{option}`test`](#test-opt-test) derivation. |
| 37 | + ''; |
| 38 | + }; |
| 39 | + platforms = mkOption { |
| 40 | + type = types.listOf types.raw; |
| 41 | + default = lib.platforms.linux ++ lib.platforms.darwin; |
| 42 | + description = '' |
| 43 | + Sets the [`meta.platforms`](https://nixos.org/manual/nixpkgs/stable/#var-meta-platforms) attribute on the [{option}`test`](#test-opt-test) derivation. |
| 44 | + ''; |
| 45 | + }; |
| 46 | + hydraPlatforms = mkOption { |
| 47 | + type = types.listOf types.raw; |
| 48 | + # Ideally this would default to `platforms` again: |
| 49 | + # default = config.platforms; |
| 50 | + default = lib.platforms.linux; |
| 51 | + defaultText = literalMD "`lib.platforms.linux` only, as the `hydra.nixos.org` build farm does not currently support virtualisation on Darwin."; |
| 52 | + description = '' |
| 53 | + Sets the [`meta.hydraPlatforms`](https://nixos.org/manual/nixpkgs/stable/#var-meta-hydraPlatforms) attribute on the [{option}`test`](#test-opt-test) derivation. |
| 54 | + ''; |
| 55 | + }; |
22 | 56 | }; |
23 | | - timeout = lib.mkOption { |
24 | | - type = types.nullOr types.int; |
25 | | - default = 3600; # 1 hour |
26 | | - description = '' |
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 = '' |
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 | | - platforms = lib.mkOption { |
38 | | - type = types.listOf types.raw; |
39 | | - # darwin could be added, but it would add VM tests that don't work on Hydra.nixos.org (so far) |
40 | | - # see https://github.com/NixOS/nixpkgs/pull/303597#issuecomment-2128782362 |
41 | | - default = lib.platforms.linux; |
42 | | - description = '' |
43 | | - Sets the [`meta.platforms`](https://nixos.org/manual/nixpkgs/stable/#var-meta-platforms) attribute on the [{option}`test`](#test-opt-test) derivation. |
44 | | - ''; |
45 | | - }; |
46 | | - }; |
47 | | - }; |
| 57 | + } |
| 58 | + ); |
48 | 59 | default = { }; |
49 | 60 | }; |
50 | 61 | }; |
|
0 commit comments