Commit 51d915e4 authored by Robert Hensing's avatar Robert Hensing
Browse files

nixos/testing: Add meta.hydraPlatforms

parent 18e2327a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -1865,6 +1865,9 @@
  "test-opt-meta.platforms": [
    "index.html#test-opt-meta.platforms"
  ],
  "test-opt-meta.hydraPlatforms": [
    "index.html#test-opt-meta.hydraPlatforms"
  ],
  "test-opt-meta.timeout": [
    "index.html#test-opt-meta.timeout"
  ],
+43 −32
Original line number Diff line number Diff line
{ lib, ... }:
let
  inherit (lib) types mkOption;
  inherit (lib) types mkOption literalExpression;
in
{
  options = {
@@ -11,7 +11,9 @@ in
        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 {
      type = types.submodule (
        { config, ... }:
        {
          options = {
            maintainers = lib.mkOption {
              type = types.listOf types.raw;
@@ -41,8 +43,17 @@ in
                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.
              '';
            };
          };
        }
      );
      default = { };
    };
  };