1# Meta Attributes {#sec-meta-attributes}
2
3Like Nix packages, NixOS modules can declare meta-attributes to provide
4extra information. Module meta attributes are defined in the `meta.nix`
5special module.
6
7`meta` is a top level attribute like `options` and `config`. Available
8meta-attributes are `maintainers`, `doc`, and `buildDocsInSandbox`.
9
10Each of the meta-attributes must be defined at most once per module
11file.
12
13```nix
14{
15 config,
16 lib,
17 pkgs,
18 ...
19}:
20{
21 options = {
22 # ...
23 };
24
25 config = {
26 # ...
27 };
28
29 meta = {
30 maintainers = with lib.maintainers; [ ];
31 doc = ./default.md;
32 buildDocsInSandbox = true;
33 };
34}
35```
36
37- `maintainers` contains a list of the module maintainers.
38
39- `doc` points to a valid [Nixpkgs-flavored CommonMark](
40 https://nixos.org/manual/nixpkgs/unstable/#sec-contributing-markup
41 ) file containing the module
42 documentation. Its contents is automatically added to
43 [](#ch-configuration). Changes to a module documentation have to
44 be checked to not break building the NixOS manual:
45
46 ```ShellSession
47 $ nix-build nixos/release.nix -A manual.x86_64-linux
48 ```
49
50- `buildDocsInSandbox` indicates whether the option documentation for the
51 module can be built in a derivation sandbox. This option is currently only
52 honored for modules shipped by nixpkgs. User modules and modules taken from
53 `extraModules` are always built outside of the sandbox, as has
54 been the case in previous releases.
55
56 Building NixOS option documentation in a sandbox allows caching of the built
57 documentation, which greatly decreases the amount of time needed to evaluate
58 a system configuration that has NixOS documentation enabled. The sandbox also
59 restricts which attributes may be referenced by documentation attributes
60 (such as option descriptions) to the `options` and `lib` module arguments and
61 the `pkgs.formats` attribute of the `pkgs` argument, `config` and the rest of
62 `pkgs` are disallowed and will cause doc build failures when used. This
63 restriction is necessary because we cannot reproduce the full nixpkgs
64 instantiation with configuration and overlays from a system configuration
65 inside the sandbox. The `options` argument only includes options of modules
66 that are also built inside the sandbox, referencing an option of a module
67 that isn't built in the sandbox is also forbidden.
68
69 The default is `true` and should usually not be changed; set it to `false`
70 only if the module requires access to `pkgs` in its documentation (e.g.
71 because it loads information from a linked package to build an option type)
72 or if its documentation depends on other modules that also aren't sandboxed
73 (e.g. by using types defined in the other module).