1<section xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="sec-meta-attributes">
2 <title>Meta Attributes</title>
3 <para>
4 Like Nix packages, NixOS modules can declare meta-attributes to
5 provide extra information. Module meta attributes are defined in the
6 <literal>meta.nix</literal> special module.
7 </para>
8 <para>
9 <literal>meta</literal> is a top level attribute like
10 <literal>options</literal> and <literal>config</literal>. Available
11 meta-attributes are <literal>maintainers</literal> and
12 <literal>doc</literal>.
13 </para>
14 <para>
15 Each of the meta-attributes must be defined at most once per module
16 file.
17 </para>
18 <programlisting language="bash">
19{ config, lib, pkgs, ... }:
20{
21 options = {
22 ...
23 };
24
25 config = {
26 ...
27 };
28
29 meta = {
30 maintainers = with lib.maintainers; [ ericsagnes ];
31 doc = ./default.xml;
32 };
33}
34</programlisting>
35 <itemizedlist>
36 <listitem>
37 <para>
38 <literal>maintainers</literal> contains a list of the module
39 maintainers.
40 </para>
41 </listitem>
42 <listitem>
43 <para>
44 <literal>doc</literal> points to a valid DocBook file containing
45 the module documentation. Its contents is automatically added to
46 <xref linkend="ch-configuration" />. Changes to a module
47 documentation have to be checked to not break building the NixOS
48 manual:
49 </para>
50 <programlisting>
51$ nix-build nixos/release.nix -A manual.x86_64-linux
52</programlisting>
53 </listitem>
54 </itemizedlist>
55</section>