nixpkgs-suyu/nixos/lib/testing/meta.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

43 lines
1.5 KiB
Nix
Raw Normal View History

{ lib, ... }:
let
2022-06-27 20:06:30 +02:00
inherit (lib) types mkOption mdDoc;
in
{
options = {
meta = lib.mkOption {
2022-06-27 20:06:30 +02:00
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 = [];
2022-06-27 20:06:30 +02:00
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;
2022-06-27 20:06:30 +02:00
default = null; # NOTE: null values are filtered out by `meta`.
description = mdDoc ''
The [{option}`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;
2022-06-27 20:06:30 +02:00
description = mdDoc ''
Sets the [`meta.broken`](https://nixos.org/manual/nixpkgs/stable/#var-meta-broken) attribute on the [{option}`test`](#opt-test) derivation.
'';
};
};
};
default = {};
};
};
}