mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-25 08:23:09 +00:00
maintainer teams: check them in lib tests
This commit is contained in:
parent
3ac995a568
commit
ff38ee15c2
@ -11,6 +11,10 @@ pkgs.runCommand "nixpkgs-lib-tests" {
|
||||
inherit pkgs;
|
||||
lib = import ../.;
|
||||
})
|
||||
(import ./teams.nix {
|
||||
inherit pkgs;
|
||||
lib = import ../.;
|
||||
})
|
||||
];
|
||||
} ''
|
||||
datadir="${pkgs.nix}/share"
|
||||
|
50
lib/tests/teams.nix
Normal file
50
lib/tests/teams.nix
Normal file
@ -0,0 +1,50 @@
|
||||
# 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)
|
Loading…
Reference in New Issue
Block a user