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