nixos doc: document coercedTo type
Also mention about docs in types.nix and fix a small error in related documentation. Fixes #26055.
This commit is contained in:
parent
8a07319e7f
commit
ee4f8c2dc9
@ -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 {
|
types = rec {
|
||||||
|
|
||||||
unspecified = mkOptionType {
|
unspecified = mkOptionType {
|
||||||
|
@ -68,8 +68,7 @@
|
|||||||
|
|
||||||
<section><title>Value Types</title>
|
<section><title>Value Types</title>
|
||||||
|
|
||||||
<para>Value types are type that take a value parameter. The only value type
|
<para>Value types are type that take a value parameter.</para>
|
||||||
in the library is <literal>enum</literal>.</para>
|
|
||||||
|
|
||||||
<variablelist>
|
<variablelist>
|
||||||
<varlistentry>
|
<varlistentry>
|
||||||
@ -141,6 +140,17 @@
|
|||||||
str</literal>. Multiple definitions cannot be
|
str</literal>. Multiple definitions cannot be
|
||||||
merged.</para></listitem>
|
merged.</para></listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
<varlistentry>
|
||||||
|
<term><varname>types.coercedTo</varname> <replaceable>from</replaceable>
|
||||||
|
<replaceable>f</replaceable> <replaceable>to</replaceable></term>
|
||||||
|
<listitem><para>Type <replaceable>to</replaceable> or type
|
||||||
|
<replaceable>from</replaceable> which will be coerced to
|
||||||
|
type <replaceable>to</replaceable> using function
|
||||||
|
<replaceable>f</replaceable> which takes an argument of type
|
||||||
|
<replaceable>from</replaceable> and return a value of type
|
||||||
|
<replaceable>to</replaceable>. Can be used to preserve backwards
|
||||||
|
compatibility of an option if its type was changed.</para></listitem>
|
||||||
|
</varlistentry>
|
||||||
</variablelist>
|
</variablelist>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user