summary refs log tree commit diff
path: root/lib/options.nix
diff options
context:
space:
mode:
Diffstat (limited to 'lib/options.nix')
-rw-r--r--lib/options.nix6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/options.nix b/lib/options.nix
index 71e02db58f69..ecbd81cd997f 100644
--- a/lib/options.nix
+++ b/lib/options.nix
@@ -80,9 +80,9 @@ rec {
           internal = opt.internal or false;
           visible = opt.visible or true;
         }
-        // optionalAttrs (opt ? example) { example = scrubOptionValue opt.example; }
-        // optionalAttrs (opt ? default) { default = scrubOptionValue opt.default; }
-        // optionalAttrs (opt ? defaultText) { default = opt.defaultText; };
+        // (if opt ? example then { example = scrubOptionValue opt.example; } else {})
+        // (if opt ? default then { default = scrubOptionValue opt.default; } else {})
+        // (if opt ? defaultText then { default = opt.defaultText; } else {});
 
         subOptions =
           let ss = opt.type.getSubOptions opt.loc;