Home Explore Blog Models CI



nixpkgs

2nd chunk of `nixos/doc/manual/contributing-to-this-manual.chapter.md`
bd9b70043e825bed229857f749d96dc80d91d7d71defcbdf0000000100000872
The documentation for all the different `configuration.nix` options is automatically generated by reading the `description`s of all the NixOS options defined at `nixos/modules/`. If you want to improve such `description`, find it in the `nixos/modules/` directory, and edit it and open a pull request.

To see how your changes render on the web, run again:

```ShellSession
$ nix-build nixos/release.nix -A manual.x86_64-linux
```

And you'll see the changes to the appendix in the path `result/share/doc/nixos/options.html`.

You can also build only the `configuration.nix(5)` manual page, via:

```ShellSession
$ cd /path/to/nixpkgs
$ nix-build nixos/release.nix -A nixos-configuration-reference-manpage.x86_64-linux
```

And observe the result via:

```ShellSession
$ man --local-file result/share/man/man5/configuration.nix.5
```

If you're on a different architecture that's supported by NixOS (check file `nixos/release.nix` on Nixpkgs' repository) then replace `x86_64-linux` with the architecture. `nix-build` will complain otherwise, but should also tell you which architecture you have + the supported ones.

## Contributing to `nixos-*` tools' manpages {#sec-contributing-nixos-tools}

The manual pages for the tools available in the installation image can be found in Nixpkgs by running (e.g for `nixos-rebuild`):

```ShellSession
$ git ls | grep nixos-rebuild.8
```

Man pages are written in [`mdoc(7)` format](https://mandoc.bsd.lv/man/mdoc.7.html) and should be portable between mandoc and groff for rendering (except for minor differences, notably different spacing rules.)

For a preview, run `man --local-file path/to/file.8`.

Being written in `mdoc`, these manpages use semantic markup. This following subsections provides a guideline on where to apply which semantic elements.

### Command lines and arguments {#ssec-contributing-nixos-tools-cli-and-args}

In any manpage, commands, flags and arguments to the *current* executable should be marked according to their semantics. Commands, flags and arguments passed to *other* executables should not be marked like this and should instead be considered as code examples and marked with `Ql`.

Title: Contributing to NixOS Documentation: Options and Tool Manpages
Summary
This document provides guidance on contributing to the NixOS manual, specifically for `configuration.nix` options and `nixos-*` tools' manpages. It explains that `configuration.nix` options documentation is auto-generated from `description` fields in `nixos/modules/`, and details how to edit these and preview changes by building the full manual or the dedicated `configuration.nix(5)` man page. For `nixos-*` tools, it instructs contributors to find relevant `.8` manpage files, which are written in `mdoc(7)` format, and offers advice on previewing and applying semantic markup for command lines and arguments.