mirror of
https://github.com/NixOS/nix
synced 2025-07-07 06:01:48 +02:00
jq -> nix
This commit is contained in:
parent
2eacc1bc00
commit
39bc49318f
8 changed files with 106 additions and 74 deletions
21
doc/manual/generate-options.nix
Normal file
21
doc/manual/generate-options.nix
Normal file
|
@ -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))
|
Loading…
Add table
Add a link
Reference in a new issue