Improve option types documentation.
This commit is contained in:
parent
983c87a1dd
commit
a3f148ce96
@ -19,7 +19,7 @@ rec {
|
|||||||
|
|
||||||
|
|
||||||
# name (name of the type)
|
# name (name of the type)
|
||||||
# check (boolean function)
|
# check (check the config value. Before returning false it should trace the bad value eg using traceValIfNot)
|
||||||
# merge (default merge function)
|
# merge (default merge function)
|
||||||
# iter (iterate on all elements contained in this type)
|
# iter (iterate on all elements contained in this type)
|
||||||
# fold (fold all elements contained in this type)
|
# fold (fold all elements contained in this type)
|
||||||
@ -196,8 +196,21 @@ rec {
|
|||||||
hasOptions = false;
|
hasOptions = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
# !!! this should be a type constructor that takes the options as
|
# usually used with listOf, attrsOf, loaOf like this:
|
||||||
# an argument.
|
# users = mkOption {
|
||||||
|
# type = loaOf optionSet;
|
||||||
|
#
|
||||||
|
# # you can omit the list if there is one element only
|
||||||
|
# options = [ {
|
||||||
|
# name = mkOption {
|
||||||
|
# description = "name of the user"
|
||||||
|
# ...
|
||||||
|
# };
|
||||||
|
# # more options here
|
||||||
|
# } { more options } ];
|
||||||
|
# }
|
||||||
|
# TODO: !!! document passing options as an argument to optionSet,
|
||||||
|
# deprecate the current approach.
|
||||||
optionSet = mkOptionType {
|
optionSet = mkOptionType {
|
||||||
name = "option set";
|
name = "option set";
|
||||||
# merge is done in "options.nix > addOptionMakeUp > handleOptionSets"
|
# merge is done in "options.nix > addOptionMakeUp > handleOptionSets"
|
||||||
|
Loading…
Reference in New Issue
Block a user