about summary refs log tree commit diff
path: root/lib/tests
diff options
context:
space:
mode:
authorGraham Christensen <graham@grahamc.com>2020-04-15 08:07:11 -0400
committerProfpatsch <mail@profpatsch.de>2022-06-20 22:20:26 +0200
commit3ac995a5680610000f36c855435062626cde1bed (patch)
tree2b44a7b1c3e7040fdc4d7834c8ebc3c7bb18da50 /lib/tests
parent9284df58c1c6af7192f7def7e2903d2b88e250ec (diff)
maintainer lib test: extract maintainer module
Diffstat (limited to 'lib/tests')
-rw-r--r--lib/tests/maintainer-module.nix31
-rw-r--r--lib/tests/maintainers.nix32
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 0000000000000..8cf8411b476a4
--- /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 aa10cc0fb4afe..d9d21ea74fbea 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;