diff options
author | Naïm Favier <n@monade.li> | 2023-05-08 14:38:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-08 14:38:35 +0200 |
commit | 6674b8a6f1bb2f220f27988eb48a4ee08d722841 (patch) | |
tree | ea47fd965d94a3f768a72ad5895a3da804e1dce9 /lib | |
parent | 3206c61bc5b495edd8be264543097265c8f790e7 (diff) | |
parent | 7cd5b9a6e8c3e4e423d7d10533cc2f1e98a4eca8 (diff) | |
download | nixlib-6674b8a6f1bb2f220f27988eb48a4ee08d722841.tar nixlib-6674b8a6f1bb2f220f27988eb48a4ee08d722841.tar.gz nixlib-6674b8a6f1bb2f220f27988eb48a4ee08d722841.tar.bz2 nixlib-6674b8a6f1bb2f220f27988eb48a4ee08d722841.tar.lz nixlib-6674b8a6f1bb2f220f27988eb48a4ee08d722841.tar.xz nixlib-6674b8a6f1bb2f220f27988eb48a4ee08d722841.tar.zst nixlib-6674b8a6f1bb2f220f27988eb48a4ee08d722841.zip |
Merge pull request #230353 from ncfavier/defaultText-only
lib/options: fix rendering of options with only a defaultText
Diffstat (limited to 'lib')
-rw-r--r-- | lib/options.nix | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/options.nix b/lib/options.nix index 4780a56fc1c3..d71d9421b7b1 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -261,7 +261,7 @@ rec { concatMap (opt: let name = showOption opt.loc; - docOption = rec { + docOption = { loc = opt.loc; inherit name; description = opt.description or null; @@ -280,9 +280,9 @@ rec { renderOptionValue opt.example ); } - // optionalAttrs (opt ? default) { + // optionalAttrs (opt ? defaultText || opt ? default) { default = - builtins.addErrorContext "while evaluating the default value of option `${name}`" ( + builtins.addErrorContext "while evaluating the ${if opt?defaultText then "defaultText" else "default value"} of option `${name}`" ( renderOptionValue (opt.defaultText or opt.default) ); } |