mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-31 14:41:27 +00:00
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 {
|
||||
|
||||
unspecified = mkOptionType {
|
||||
|
@ -68,8 +68,7 @@
|
||||
|
||||
<section><title>Value Types</title>
|
||||
|
||||
<para>Value types are type that take a value parameter. The only value type
|
||||
in the library is <literal>enum</literal>.</para>
|
||||
<para>Value types are type that take a value parameter.</para>
|
||||
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
@ -141,6 +140,17 @@
|
||||
str</literal>. Multiple definitions cannot be
|
||||
merged.</para></listitem>
|
||||
</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>
|
||||
|
||||
</section>
|
||||
|
Loading…
Reference in New Issue
Block a user