2022-06-06 13:29:04 +02:00
{ lib , . . . }:
let
2025-05-09 16:11:14 +02:00
inherit ( lib ) types mkOption literalExpression ;
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 ;
default = config . platforms ;
defaultText = literalExpression " m e t a . p l a t f o r m s " ;
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
} ;
} ;
}