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