mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-18 11:40:45 +00:00
Merge pull request #230353 from ncfavier/defaultText-only
lib/options: fix rendering of options with only a defaultText
This commit is contained in:
commit
6674b8a6f1
|
@ -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)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue