Manual declarations

You can declare Nix objects manually by using the following directives.

Use these directives when generating from Nix code isn’t possible or if you want to develop a custom documentation generator.

See also

Manual example for more manual usage examples.

.. nix:option:: name

Describes a option from the NixOS module system.

For example:

.. nix:option:: service.my-service.enable

   My option description

Is redendered as:

service.my-service.enable

My option description

Options

:type: (text)

The type of the option, for example list of string.

:read-only:

Add this option of the option is read-only.

:declaration: (text)

A link to the source code. See the nix_linkcode_resolve configuration to generate a [source] link.

:short-toc-name:

Whether to show a short name in the table of contents.

Other standard domain options are supported, see the Sphinx domain Basic Markup documentation.

.. nix:package:: name

Describes a Nix package.

Use field-lists after the description to describe the package’s metadata

For example:

.. nix:package:: myProject.myPackage

   My package description

   :version: 0.0.0-rc1
   :license: EUPL-1.2

Will be redendered as:

myProject.myPackage

My package description

Version:

0.0.0-rc1

License:

EUPL-1.2

Options

:declaration: (text)

A link to the source code. See the nix_linkcode_resolve configuration to generate a [source] link.

:short-toc-name:

Whether to show a short name in the table of contents.

Other standard domain options are supported, see the Sphinx domain Basic Markup documentation.