1# to run these tests:
2# nix-build nixpkgs/lib/tests/teams.nix
3# If it builds, all tests passed
4{
5 pkgs ? import ../.. { },
6 lib ? pkgs.lib,
7}:
8
9let
10 inherit (lib) types;
11
12 teamModule =
13 { config, ... }:
14 {
15 options = {
16 shortName = lib.mkOption {
17 type = types.str;
18 };
19 scope = lib.mkOption {
20 type = types.str;
21 };
22 enableFeatureFreezePing = lib.mkOption {
23 type = types.bool;
24 default = false;
25 };
26 members = lib.mkOption {
27 type = types.listOf (types.submodule (import ./maintainer-module.nix { inherit lib; }));
28 default = [ ];
29 };
30 githubTeams = lib.mkOption {
31 type = types.listOf types.str;
32 default = [ ];
33 };
34 };
35 };
36
37 checkTeam =
38 team: uncheckedAttrs:
39 let
40 prefix = [
41 "lib"
42 "maintainer-team"
43 team
44 ];
45 checkedAttrs =
46 (lib.modules.evalModules {
47 inherit prefix;
48 modules = [
49 teamModule
50 {
51 _file = toString ../../maintainers/team-list.nix;
52 config = uncheckedAttrs;
53 }
54 ];
55 }).config;
56 in
57 checkedAttrs;
58
59 checkedTeams = lib.mapAttrs checkTeam lib.teams;
60in
61pkgs.writeTextDir "maintainer-teams.json" (builtins.toJSON checkedTeams)