nixos/testing: Add meta.hydraPlatforms

This commit is contained in:
Robert Hensing 2025-05-09 16:11:14 +02:00
parent 18e2327aa7
commit 51d915e451
2 changed files with 46 additions and 32 deletions

View File

@ -1865,6 +1865,9 @@
"test-opt-meta.platforms": [ "test-opt-meta.platforms": [
"index.html#test-opt-meta.platforms" "index.html#test-opt-meta.platforms"
], ],
"test-opt-meta.hydraPlatforms": [
"index.html#test-opt-meta.hydraPlatforms"
],
"test-opt-meta.timeout": [ "test-opt-meta.timeout": [
"index.html#test-opt-meta.timeout" "index.html#test-opt-meta.timeout"
], ],

View File

@ -1,6 +1,6 @@
{ lib, ... }: { lib, ... }:
let let
inherit (lib) types mkOption; inherit (lib) types mkOption literalExpression;
in in
{ {
options = { options = {
@ -11,38 +11,49 @@ in
Not all [`meta`](https://nixos.org/manual/nixpkgs/stable/#chap-meta) attributes are supported, but more can be added as desired. 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); apply = lib.filterAttrs (k: v: v != null);
type = types.submodule { type = types.submodule (
options = { { config, ... }:
maintainers = lib.mkOption { {
type = types.listOf types.raw; options = {
default = [ ]; maintainers = lib.mkOption {
description = '' type = types.listOf types.raw;
The [list of maintainers](https://nixos.org/manual/nixpkgs/stable/#var-meta-maintainers) for this test. default = [ ];
''; description = ''
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 = ''
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 = ''
Sets the [`meta.broken`](https://nixos.org/manual/nixpkgs/stable/#var-meta-broken) attribute on the [{option}`test`](#test-opt-test) derivation.
'';
};
platforms = lib.mkOption {
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.
'';
};
hydraPlatforms = lib.mkOption {
type = types.listOf types.raw;
default = config.platforms;
defaultText = literalExpression "meta.platforms";
description = ''
Sets the [`meta.hydraPlatforms`](https://nixos.org/manual/nixpkgs/stable/#var-meta-hydraPlatforms) attribute on the [{option}`test`](#test-opt-test) derivation.
'';
};
}; };
timeout = lib.mkOption { }
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.
'';
};
broken = lib.mkOption {
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.
'';
};
platforms = lib.mkOption {
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.
'';
};
};
};
default = { }; default = { };
}; };
}; };