diff --git a/lib/types.nix b/lib/types.nix index 45122759bfca..b06cc9eedaa9 100644 --- a/lib/types.nix +++ b/lib/types.nix @@ -92,6 +92,8 @@ rec { }; + # When adding new types don't forget to document them in + # nixos/doc/manual/development/option-types.xml! types = rec { unspecified = mkOptionType { diff --git a/nixos/doc/manual/development/option-types.xml b/nixos/doc/manual/development/option-types.xml index 741e763c295c..e928c5570874 100644 --- a/nixos/doc/manual/development/option-types.xml +++ b/nixos/doc/manual/development/option-types.xml @@ -68,8 +68,7 @@
Value Types - Value types are type that take a value parameter. The only value type - in the library is enum. + Value types are type that take a value parameter. @@ -141,6 +140,17 @@ str. Multiple definitions cannot be merged. + + types.coercedTo from + f to + Type to or type + from which will be coerced to + type to using function + f which takes an argument of type + from and return a value of type + to. Can be used to preserve backwards + compatibility of an option if its type was changed. +