mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-03-08 01:24:09 +01:00
modules/generic/meta-maintainers.nix: Check validity of meta.maintainers
And fix a case where it wasn't valid
This commit is contained in:
parent
516a14cd33
commit
3dc5545d51
3 changed files with 18 additions and 3 deletions
|
|
@ -17,7 +17,14 @@ in
|
|||
options = {
|
||||
meta = {
|
||||
maintainers = mkOption {
|
||||
type = sourceList;
|
||||
type =
|
||||
let
|
||||
allMaintainers = lib.attrValues lib.maintainers;
|
||||
in
|
||||
lib.types.addCheck sourceList (lib.all (v: lib.elem v allMaintainers))
|
||||
// {
|
||||
description = "list of lib.maintainers";
|
||||
};
|
||||
default = [ ];
|
||||
example = lib.literalExpression "[ lib.maintainers.alice lib.maintainers.bob ]";
|
||||
description = ''
|
||||
|
|
|
|||
|
|
@ -14,9 +14,17 @@ let
|
|||
};
|
||||
in
|
||||
rec {
|
||||
lib = import ../../../lib;
|
||||
# Inject ghost into lib.maintainers so it passes the addCheck validation
|
||||
lib = (import ../../../lib).extend (
|
||||
final: prev: {
|
||||
maintainers = prev.maintainers // {
|
||||
inherit ghost;
|
||||
};
|
||||
}
|
||||
);
|
||||
|
||||
example = lib.evalModules {
|
||||
specialArgs.lib = lib;
|
||||
modules = [
|
||||
../meta-maintainers.nix
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue