mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-11-10 09:43:30 +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 {
|
maintainer = mkOptionType {
|
||||||
name = "maintainer";
|
name = "maintainer";
|
||||||
check = email: lib.elem email (lib.attrValues lib.maintainers);
|
check = email: lib.elem email (lib.attrValues lib.maintainers);
|
||||||
merge =
|
merge = loc: defs: {
|
||||||
loc: defs:
|
# lib.last: Perhaps this could be merged instead, if "at most once per module"
|
||||||
lib.listToAttrs (lib.singleton (lib.nameValuePair (lib.last defs).file (lib.last defs).value));
|
# is a problem (see option description).
|
||||||
|
${(lib.last defs).file} = (lib.last defs).value;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
listOfMaintainers = types.listOf maintainer // {
|
listOfMaintainers = types.listOf maintainer // {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue