2018-07-20 22:56:59 +02:00
|
|
|
{ lib, ... }:
|
2014-08-25 00:46:23 +02:00
|
|
|
|
|
|
|
with lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
maintainer = mkOptionType {
|
|
|
|
name = "maintainer";
|
|
|
|
check = email: elem email (attrValues lib.maintainers);
|
|
|
|
merge = loc: defs: listToAttrs (singleton (nameValuePair (last defs).file (last defs).value));
|
|
|
|
};
|
|
|
|
|
|
|
|
listOfMaintainers = types.listOf maintainer // {
|
|
|
|
# Returns list of
|
|
|
|
# { "module-file" = [
|
|
|
|
# "maintainer1 <first@nixos.org>"
|
|
|
|
# "maintainer2 <second@nixos.org>" ];
|
|
|
|
# }
|
|
|
|
merge = loc: defs:
|
|
|
|
zipAttrs
|
2017-07-05 00:29:23 +02:00
|
|
|
(flatten (imap1 (n: def: imap1 (m: def':
|
2014-08-25 00:46:23 +02:00
|
|
|
maintainer.merge (loc ++ ["[${toString n}-${toString m}]"])
|
|
|
|
[{ inherit (def) file; value = def'; }]) def.value) defs));
|
|
|
|
};
|
|
|
|
|
|
|
|
docFile = types.path // {
|
|
|
|
# Returns tuples of
|
|
|
|
# { file = "module location"; value = <path/to/doc.xml>; }
|
|
|
|
merge = loc: defs: defs;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
meta = {
|
|
|
|
|
|
|
|
maintainers = mkOption {
|
|
|
|
type = listOfMaintainers;
|
|
|
|
internal = true;
|
|
|
|
default = [];
|
2021-11-26 01:16:05 +01:00
|
|
|
example = literalExpression ''[ lib.maintainers.all ]'';
|
2014-08-25 00:46:23 +02:00
|
|
|
description = ''
|
2016-05-09 07:53:27 +02:00
|
|
|
List of maintainers of each module. This option should be defined at
|
2014-08-25 00:46:23 +02:00
|
|
|
most once per module.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
doc = mkOption {
|
|
|
|
type = docFile;
|
|
|
|
internal = true;
|
2021-02-21 06:50:05 +01:00
|
|
|
example = "./meta.chapter.xml";
|
2014-08-25 00:46:23 +02:00
|
|
|
description = ''
|
2021-02-21 06:50:05 +01:00
|
|
|
Documentation prologue for the set of options of each module. This
|
2014-08-25 00:46:23 +02:00
|
|
|
option should be defined at most once per module.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2021-11-19 00:26:27 +01:00
|
|
|
buildDocsInSandbox = mkOption {
|
|
|
|
type = types.bool // {
|
|
|
|
merge = loc: defs: defs;
|
|
|
|
};
|
|
|
|
internal = true;
|
|
|
|
default = true;
|
|
|
|
description = ''
|
|
|
|
Whether to include this module in the split options doc build.
|
|
|
|
Disable if the module references `config`, `pkgs` or other module
|
|
|
|
arguments that cannot be evaluated as constants.
|
|
|
|
|
|
|
|
This option should be defined at most once per module.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2014-08-25 00:46:23 +02:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2016-05-09 07:53:27 +02:00
|
|
|
meta.maintainers = singleton lib.maintainers.pierron;
|
2014-08-25 00:46:23 +02:00
|
|
|
}
|