From 16df9822abede529a22ba206cb1f10c0b586c9e0 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 23 Nov 2019 00:26:42 +0100 Subject: [PATCH] maintainers: Add support for teams * meta.maintainers can contain either individual maintainers or maintainer teams * maintainer teams can be nested * multiple teams can have overlapping membership --- ofborg/src/maintainers.nix | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/ofborg/src/maintainers.nix b/ofborg/src/maintainers.nix index c5197252..bf4896d5 100644 --- a/ofborg/src/maintainers.nix +++ b/ofborg/src/maintainers.nix @@ -36,8 +36,22 @@ let (pkg: pkg // { package = pkgs.lib.attrsets.attrByPath pkg.path null pkgs; }) validPackageAttributes; + # meta.maintainers can contain either individual maintainers or maintainer teams + # maintainer teams can be nested + # multiple teams can have overlapping membership + extractMembersFromTeams = maintainers: + (pkg.lib.lists.unique ( + builtins.concatMap + (maintainerOrTeam: + if maintainerOrTeam ? members + then extractMembersFromTeams maintainerOrTeam.members + else [ maintainerOrTeam ] + ) + maintainers + )); + attrsWithMaintainers = builtins.map - (pkg: pkg // { maintainers = (pkg.package.meta or {}).maintainers or []; }) + (pkg: pkg // { maintainers = extractMembersFromTeams (pkg.package.meta or {}).maintainers or []; }) attrsWithPackages; attrsWeCanPing = builtins.filter