2022-06-06 13:29:04 +02:00
{ lib , . . . }:
let
2025-05-09 19:25:21 +02:00
inherit ( lib ) types mkOption literalMD ;
2022-06-06 13:29:04 +02:00
in
{
options = {
2025-05-09 16:17:17 +02:00
meta = mkOption {
2024-04-01 16:58:23 -07:00
description = ''
2022-06-27 20:06:30 +02:00
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.
'' ;
2022-06-26 00:13:03 +02:00
apply = lib . filterAttrs ( k : v : v != null ) ;
2025-05-09 16:11:14 +02:00
type = types . submodule (
{ config , . . . }:
{
options = {
2025-05-09 16:17:17 +02:00
maintainers = mkOption {
2025-05-09 16:11:14 +02:00
type = types . listOf types . raw ;
default = [ ] ;
description = ''
The [ list of maintainers ] ( https://nixos.org/manual/nixpkgs/stable/ #var-meta-maintainers) for this test.
'' ;
} ;
2025-05-09 16:17:17 +02:00
timeout = mkOption {
2025-05-09 16:11:14 +02:00
type = types . nullOr types . int ;
default = 3600 ; # 1 hour
description = ''
The [ { option } ` test ` ] ( #test-opt-test)'s [`meta.timeout`](https://nixos.org/manual/nixpkgs/stable/#var-meta-timeout) in seconds.
'' ;
} ;
2025-05-09 16:17:17 +02:00
broken = mkOption {
2025-05-09 16:11:14 +02:00
type = types . bool ;
default = false ;
description = ''
Sets the [ ` meta . broken ` ] ( https://nixos.org/manual/nixpkgs/stable/ #var-meta-broken) attribute on the [{option}`test`](#test-opt-test) derivation.
'' ;
} ;
2025-05-09 16:17:17 +02:00
platforms = mkOption {
2025-05-09 16:11:14 +02:00
type = types . listOf types . raw ;
default = lib . platforms . linux ++ lib . platforms . darwin ;
description = ''
Sets the [ ` meta . platforms ` ] ( https://nixos.org/manual/nixpkgs/stable/ #var-meta-platforms) attribute on the [{option}`test`](#test-opt-test) derivation.
'' ;
} ;
2025-05-09 16:17:17 +02:00
hydraPlatforms = mkOption {
2025-05-09 16:11:14 +02:00
type = types . listOf types . raw ;
2025-05-09 19:25:21 +02:00
# Ideally this would default to `platforms` again:
# default = config.platforms;
default = lib . platforms . linux ;
defaultText = literalMD " ` l i b . p l a t f o r m s . l i n u x ` o n l y , a s t h e ` h y d r a . n i x o s . o r g ` b u i l d f a r m d o e s n o t c u r r e n t l y s u p p o r t v i r t u a l i s a t i o n o n D a r w i n . " ;
2025-05-09 16:11:14 +02:00
description = ''
Sets the [ ` meta . hydraPlatforms ` ] ( https://nixos.org/manual/nixpkgs/stable/ #var-meta-hydraPlatforms) attribute on the [{option}`test`](#test-opt-test) derivation.
'' ;
} ;
2022-06-26 00:13:03 +02:00
} ;
2025-05-09 16:11:14 +02:00
}
) ;
2022-06-26 00:13:03 +02:00
default = { } ;
2022-06-06 13:29:04 +02:00
} ;
} ;
}