nixos/doc: add types
prefix to addCheck
example
The function `addCheck` resides within the attrset `types`. We should be explicit about this since otherwise people might be confused where it does come from / why it doesn't work for them.
This commit is contained in:
parent
6fa3dd2d5a
commit
c55427ca43
@ -512,7 +512,7 @@ config.mod.two = { foo = 2; bar = "two"; };</screen>
|
|||||||
The function to type check the value. Takes a value as parameter and
|
The function to type check the value. Takes a value as parameter and
|
||||||
return a boolean. It is possible to extend a type check with the
|
return a boolean. It is possible to extend a type check with the
|
||||||
<literal>addCheck</literal> function
|
<literal>addCheck</literal> function
|
||||||
(<xref
|
(<xref
|
||||||
linkend='ex-extending-type-check-1' />), or to fully
|
linkend='ex-extending-type-check-1' />), or to fully
|
||||||
override the check function
|
override the check function
|
||||||
(<xref linkend='ex-extending-type-check-2' />).
|
(<xref linkend='ex-extending-type-check-2' />).
|
||||||
@ -522,7 +522,7 @@ config.mod.two = { foo = 2; bar = "two"; };</screen>
|
|||||||
<screen>
|
<screen>
|
||||||
byte = mkOption {
|
byte = mkOption {
|
||||||
description = "An integer between 0 and 255.";
|
description = "An integer between 0 and 255.";
|
||||||
type = addCheck types.int (x: x >= 0 && x <= 255);
|
type = types.addCheck types.int (x: x >= 0 && x <= 255);
|
||||||
};</screen>
|
};</screen>
|
||||||
</example>
|
</example>
|
||||||
<example xml:id='ex-extending-type-check-2'>
|
<example xml:id='ex-extending-type-check-2'>
|
||||||
|
Loading…
Reference in New Issue
Block a user