diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-30 15:33:20 +0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-30 15:35:09 +0100 |
commit | 70a2c545274cda238c5eda28b60cfa9dbc6f7ed6 (patch) | |
tree | d3629d90b938f5be866f2977c26976198f4ab014 /lib/options.nix | |
parent | db2a9afb75abc50497fcde61470c2b83795e4669 (diff) |
Strictly check the arguments to mkOption
And fix various instances of bad arguments.
Diffstat (limited to '')
-rw-r--r-- | lib/options.nix | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/options.nix b/lib/options.nix index 5a05775e8c25..d1a161cf7633 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; |