mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-09 16:18:34 +01:00
modules/meta-maintainers: Refactor maintainer type merge function
Easily tested now. Thank you Matt for this suggestion! Co-Authored-By: Robert Hensing <robert@roberthensing.nl>
This commit is contained in:
parent
0c156a7144
commit
79748defd7
|
|
@ -11,9 +11,11 @@ let
|
|||
maintainer = mkOptionType {
|
||||
name = "maintainer";
|
||||
check = email: lib.elem email (lib.attrValues lib.maintainers);
|
||||
merge =
|
||||
loc: defs:
|
||||
lib.listToAttrs (lib.singleton (lib.nameValuePair (lib.last defs).file (lib.last defs).value));
|
||||
merge = loc: defs: {
|
||||
# lib.last: Perhaps this could be merged instead, if "at most once per module"
|
||||
# is a problem (see option description).
|
||||
${(lib.last defs).file} = (lib.last defs).value;
|
||||
};
|
||||
};
|
||||
|
||||
listOfMaintainers = types.listOf maintainer // {
|
||||
|
|
|
|||
Loading…
Reference in a new issue