maintainer lib test: extract maintainer module

Changed files
+32 -31
lib
+31
lib/tests/maintainer-module.nix
···
+
{ lib, ... }:
+
let
+
inherit (lib) types;
+
in {
+
options = {
+
name = lib.mkOption {
+
type = types.str;
+
};
+
email = lib.mkOption {
+
type = types.str;
+
};
+
matrix = lib.mkOption {
+
type = types.nullOr types.str;
+
default = null;
+
};
+
github = lib.mkOption {
+
type = types.nullOr types.str;
+
default = null;
+
};
+
githubId = lib.mkOption {
+
type = types.nullOr types.ints.unsigned;
+
default = null;
+
};
+
keys = lib.mkOption {
+
type = types.listOf (types.submodule {
+
options.fingerprint = lib.mkOption { type = types.str; };
+
});
+
default = [];
+
};
+
};
+
}
+1 -31
lib/tests/maintainers.nix
···
let
inherit (lib) types;
-
-
maintainerModule = { config, ... }: {
-
options = {
-
name = lib.mkOption {
-
type = types.str;
-
};
-
email = lib.mkOption {
-
type = types.str;
-
};
-
matrix = lib.mkOption {
-
type = types.nullOr types.str;
-
default = null;
-
};
-
github = lib.mkOption {
-
type = types.nullOr types.str;
-
default = null;
-
};
-
githubId = lib.mkOption {
-
type = types.nullOr types.ints.unsigned;
-
default = null;
-
};
-
keys = lib.mkOption {
-
type = types.listOf (types.submodule {
-
options.fingerprint = lib.mkOption { type = types.str; };
-
});
-
default = [];
-
};
-
};
-
};
-
checkMaintainer = handle: uncheckedAttrs:
let
prefix = [ "lib" "maintainers" handle ];
checkedAttrs = (lib.modules.evalModules {
inherit prefix;
modules = [
-
maintainerModule
+
./maintainer-module.nix
{
_file = toString ../../maintainers/maintainer-list.nix;
config = uncheckedAttrs;