aboutsummaryrefslogtreecommitdiff
path: root/doc/manual/generate-options.nix
blob: 7afe279c3738273e2f243eed76d1d51595664971 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
with builtins;
with import ./utils.nix;

options:

concatStrings (map
  (name:
    let option = options.${name}; in
    "  - `${name}`  \n\n"
    + concatStrings (map (s: "    ${s}\n") (splitLines option.description)) + "\n\n"
    + "    **Default:** " + (
      if option.value == "" || option.value == []
      then "*empty*"
      else if isBool option.value
      then (if option.value then "`true`" else "`false`")
      else "`" + toString option.value + "`") + "\n\n"
    + (if option.aliases != []
       then "    **Deprecated alias:** " + (concatStringsSep ", " (map (s: "`${s}`") option.aliases)) + "\n\n"
       else "")
    )
  (attrNames options))