2020-09-16 12:55:24 +00:00
|
|
|
with builtins;
|
|
|
|
with import ./utils.nix;
|
|
|
|
|
|
|
|
options:
|
|
|
|
|
|
|
|
concatStrings (map
|
|
|
|
(name:
|
|
|
|
let option = options.${name}; in
|
2022-04-05 11:34:25 +00:00
|
|
|
" - [`${name}`](#conf-${name})"
|
|
|
|
+ "<p id=\"conf-${name}\"></p>\n\n"
|
2020-09-16 12:55:24 +00:00
|
|
|
+ concatStrings (map (s: " ${s}\n") (splitLines option.description)) + "\n\n"
|
2021-12-01 15:08:23 +00:00
|
|
|
+ (if option.documentDefault
|
|
|
|
then " **Default:** " + (
|
|
|
|
if option.value == "" || option.value == []
|
|
|
|
then "*empty*"
|
|
|
|
else if isBool option.value
|
|
|
|
then (if option.value then "`true`" else "`false`")
|
|
|
|
else
|
|
|
|
# n.b. a StringMap value type is specified as a string, but
|
|
|
|
# this shows the value type. The empty stringmap is "null" in
|
|
|
|
# JSON, but that converts to "{ }" here.
|
|
|
|
(if isAttrs option.value then "`\"\"`"
|
|
|
|
else "`" + toString option.value + "`")) + "\n\n"
|
2022-02-15 21:44:05 +00:00
|
|
|
else " **Default:** *machine-specific*\n")
|
2020-09-16 12:55:24 +00:00
|
|
|
+ (if option.aliases != []
|
|
|
|
then " **Deprecated alias:** " + (concatStringsSep ", " (map (s: "`${s}`") option.aliases)) + "\n\n"
|
|
|
|
else "")
|
|
|
|
)
|
|
|
|
(attrNames options))
|