From 70a2c545274cda238c5eda28b60cfa9dbc6f7ed6 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 30 Oct 2013 15:33:20 +0100 Subject: Strictly check the arguments to mkOption And fix various instances of bad arguments. --- lib/options.nix | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'lib/options.nix') diff --git a/lib/options.nix b/lib/options.nix index 5a05775e8c2..d1a161cf763 100644 --- a/lib/options.nix +++ b/lib/options.nix @@ -11,17 +11,18 @@ with import ./strings.nix; rec { isOption = lib.isType "option"; - mkOption = attrs: attrs // { - _type = "option"; - # name (this is the name of the attributem it is automatically generated by the traversal) - # default (value used when no definition exists) - # example (documentation) - # description (documentation) - # type (option type, provide a default merge function and ensure type correctness) - # merge (function used to merge definitions into one definition: [ /type/ ] -> /type/) - # apply (convert the option value to ease the manipulation of the option result) - # options (set of sub-options declarations & definitions) - }; + mkOption = + { default ? null # Default value used when no definition is given in the configuration. + , defaultText ? null # Textual representation of the default, for in the manual. + , example ? null # Example value used in the manual. + , description ? null # String describing the option. + , type ? null # Option type, providing type-checking and value merging. + , apply ? null # Function that converts the option value to something else. + , internal ? null # Whether the option is for NixOS developers only. + , visible ? null # Whether the option shows up in the manual. + , options ? null # Obsolete, used by types.optionSet. + } @ attrs: + attrs // { _type = "option"; }; mkEnableOption = name: mkOption { default = false; -- cgit 1.4.1