diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-09-16 14:55:24 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-09-16 14:58:06 +0200 |
commit | 39bc49318f64d30b945d9dbb4f96f225d25dbd50 (patch) | |
tree | ba2a2e1791a1d2c30a779ff901302ecbf6c14ce8 /doc/manual/generate-options.nix | |
parent | 2eacc1bc00fcc3bccd470b846062c63bc408be05 (diff) |
jq -> nix
Diffstat (limited to 'doc/manual/generate-options.nix')
-rw-r--r-- | doc/manual/generate-options.nix | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/manual/generate-options.nix b/doc/manual/generate-options.nix new file mode 100644 index 000000000..7afe279c3 --- /dev/null +++ b/doc/manual/generate-options.nix @@ -0,0 +1,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)) |