diff options
author | Graham Christensen <graham@grahamc.com> | 2020-04-15 08:07:11 -0400 |
---|---|---|
committer | Profpatsch <mail@profpatsch.de> | 2022-06-20 22:20:26 +0200 |
commit | 3ac995a5680610000f36c855435062626cde1bed (patch) | |
tree | 2b44a7b1c3e7040fdc4d7834c8ebc3c7bb18da50 /lib | |
parent | 9284df58c1c6af7192f7def7e2903d2b88e250ec (diff) | |
download | nixlib-3ac995a5680610000f36c855435062626cde1bed.tar nixlib-3ac995a5680610000f36c855435062626cde1bed.tar.gz nixlib-3ac995a5680610000f36c855435062626cde1bed.tar.bz2 nixlib-3ac995a5680610000f36c855435062626cde1bed.tar.lz nixlib-3ac995a5680610000f36c855435062626cde1bed.tar.xz nixlib-3ac995a5680610000f36c855435062626cde1bed.tar.zst nixlib-3ac995a5680610000f36c855435062626cde1bed.zip |
maintainer lib test: extract maintainer module
Diffstat (limited to 'lib')
-rw-r--r-- | lib/tests/maintainer-module.nix | 31 | ||||
-rw-r--r-- | lib/tests/maintainers.nix | 32 |
2 files changed, 32 insertions, 31 deletions
diff --git a/lib/tests/maintainer-module.nix b/lib/tests/maintainer-module.nix new file mode 100644 index 000000000000..8cf8411b476a --- /dev/null +++ b/lib/tests/maintainer-module.nix @@ -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 = []; + }; + }; +} diff --git a/lib/tests/maintainers.nix b/lib/tests/maintainers.nix index aa10cc0fb4af..d9d21ea74fbe 100644 --- a/lib/tests/maintainers.nix +++ b/lib/tests/maintainers.nix @@ -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; |