forked from mirrors/nixpkgs
maintainer lib test: extract maintainer module
This commit is contained in:
parent
9284df58c1
commit
3ac995a568
31
lib/tests/maintainer-module.nix
Normal file
31
lib/tests/maintainer-module.nix
Normal file
|
@ -0,0 +1,31 @@
|
|||
{ 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 = [];
|
||||
};
|
||||
};
|
||||
}
|
|
@ -7,43 +7,13 @@
|
|||
|
||||
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;
|
||||
|
|
Loading…
Reference in a new issue