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