[Nix-dev] More Typing and nested mkOptions

Artyom Shalkhakov artyom.shalkhakov at gmail.com
Thu Jan 8 13:01:30 CET 2009


Hello,

Can anybody tell me if it's possible to nest mkOptions?
(I've tried to look up it's implementation, but noticed
strange __names and didn't look further).

Here's an example (oversimplified):

/* Each potential network/access point should have a
   "network block" that describes how to identify it and
   how to set up security. (from the wpa_supplicant man)
*/
interfaces = mkOption {
   default = [] # nothing by default
   # how do you describe the following?
   example = {
     name = "foobar"; # name of the interface
     networks = [
       ...
     ];
   }
}

Also, how about some typing or meta-information? For
example, if we gave each option a type (a set of possible
values, that is), we could check user input, generate more
documentation, build simple administrative GUIs, and so on.

Cheers,
Artyom Shalkhakov.



More information about the nix-dev mailing list