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:
Matt Sturgeon 2025-08-10 13:35:15 +02:00 committed by Robert Hensing
parent 0c156a7144
commit 79748defd7

View file

@ -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 // {