summary refs log tree commit diff
path: root/lib/options.nix
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-17 14:29:51 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-10-17 14:29:51 +0200
commitad0568e64a5a58a1dc6b02e3a62073043a44bbc4 (patch)
treeaed3a897537873adbf9b8b1f98b5fd4d52ec63b4 /lib/options.nix
parent04690da3bd76c99c4fa549814ff1c7d3a8695c4f (diff)
downloadnixlib-ad0568e64a5a58a1dc6b02e3a62073043a44bbc4.tar
nixlib-ad0568e64a5a58a1dc6b02e3a62073043a44bbc4.tar.gz
nixlib-ad0568e64a5a58a1dc6b02e3a62073043a44bbc4.tar.bz2
nixlib-ad0568e64a5a58a1dc6b02e3a62073043a44bbc4.tar.lz
nixlib-ad0568e64a5a58a1dc6b02e3a62073043a44bbc4.tar.xz
nixlib-ad0568e64a5a58a1dc6b02e3a62073043a44bbc4.tar.zst
nixlib-ad0568e64a5a58a1dc6b02e3a62073043a44bbc4.zip
mkEnableOption: Add a period at the end of the description
Diffstat (limited to 'lib/options.nix')
-rw-r--r--lib/options.nix8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/options.nix b/lib/options.nix
index 8ea9df3cbd64..a91115287e45 100644
--- a/lib/options.nix
+++ b/lib/options.nix
@@ -31,7 +31,7 @@ rec {
   mkEnableOption = name: mkOption {
     default = false;
     example = true;
-    description = "Whether to enable ${name}";
+    description = "Whether to enable ${name}.";
     type = lib.types.bool;
   };
 
@@ -272,9 +272,7 @@ rec {
         let
           docOption = {
             inherit (opt) name;
-            description = if opt ? description then opt.description else
-              throw "Option ${opt.name}: No description.";
-
+            description = opt.description or (throw "Option ${opt.name}: No description.");
             declarations = map (x: toString x.source) opt.declarations;
             #definitions = map (x: toString x.source) opt.definitions;
           }
@@ -297,7 +295,7 @@ rec {
      generation of `options.xml' much more efficient: the XML
      representation of derivations is very large (on the order of
      megabytes) and is not actually used by the manual generator. */
-  scrubOptionValue = x: 
+  scrubOptionValue = x:
     if isDerivation x then { type = "derivation"; drvPath = x.name; outPath = x.name; name = x.name; }
     else if isList x then map scrubOptionValue x
     else if isAttrs x then mapAttrs (n: v: scrubOptionValue v) (removeAttrs x ["_args"])