@@ -250,6 +250,61 @@ meta.platforms = stdenv.lib.platforms.linux;
250250 </para>
251251 </listitem>
252252 </varlistentry>
253+ <varlistentry>
254+ <term>
255+ <varname>tests</varname>
256+ </term>
257+ <listitem>
258+ <para>
259+ An attribute set with as values tests. A test is a derivation, which
260+ builds successfully when the test passes, and fails to build otherwise. A
261+ derivation that is a test requires some <literal>meta</literal> elements
262+ to be defined: <literal>needsVMSupport</literal> (automatically filled-in
263+ for NixOS tests) and <literal>timeout</literal>.
264+ </para>
265+ <para>
266+ The NixOS tests are available as <literal>nixosTests</literal> in
267+ parameters of derivations. For instance, the OpenSMTPD derivation
268+ includes lines similar to:
269+<programlisting>
270+{ /* ... */, nixosTests }:
271+{
272+ # ...
273+ meta.tests = {
274+ basic-functionality-and-dovecot-integration = nixosTests.opensmtpd;
275+ };
276+}
277+</programlisting>
278+ </para>
279+ </listitem>
280+ </varlistentry>
281+ <varlistentry>
282+ <term>
283+ <varname>timeout</varname>
284+ </term>
285+ <listitem>
286+ <para>
287+ A timeout (in seconds) for building the derivation. If the derivation
288+ takes longer than this time to build, it can fail due to breaking the
289+ timeout. However, all computers do not have the same computing power,
290+ hence some builders may decide to apply a multiplicative factor to this
291+ value. When filling this value in, try to keep it approximately
292+ consistent with other values already present in
293+ <literal>nixpkgs</literal>.
294+ </para>
295+ </listitem>
296+ </varlistentry>
297+ <varlistentry>
298+ <term>
299+ <varname>needsVMSupport</varname>
300+ </term>
301+ <listitem>
302+ <para>
303+ A boolan that states whether the derivation requires build-time support
304+ for Virtual Machine to build successfully.
305+ </para>
306+ </listitem>
307+ </varlistentry>
253308 <varlistentry>
254309 <term>
255310 <varname>hydraPlatforms</varname>