From ee4f8c2dc98f10b75242b526245229e24baa6010 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 24 May 2017 15:51:01 +0300 Subject: [PATCH] nixos doc: document coercedTo type Also mention about docs in types.nix and fix a small error in related documentation. Fixes #26055. --- lib/types.nix | 2 ++ nixos/doc/manual/development/option-types.xml | 14 ++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) 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. +