2021-01-29 10:21:25 +01:00
|
|
|
Contribute or troubleshoot
|
|
|
|
==========================
|
2020-07-02 21:02:47 +02:00
|
|
|
|
2021-03-10 18:46:03 +01:00
|
|
|
To report an issue, please go to
|
|
|
|
`<https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/issues>`_.
|
|
|
|
|
2025-05-08 18:53:01 +02:00
|
|
|
If you have questions, feel free to reach out:
|
|
|
|
|
|
|
|
* Matrix: `#nixos-mailserver:nixos.org <https://matrix.to/#/#nixos-mailserver:nixos.org>`__
|
|
|
|
* IRC: `#nixos-mailserver <ircs://irc.libera.chat/nixos-mailserver>`__ on `Libera Chat <https://libera.chat/guides/connect>`__
|
2021-03-10 18:46:03 +01:00
|
|
|
|
2025-05-08 18:53:25 +02:00
|
|
|
All our workflows rely on Nix being configured with `Flakes <https://wiki.nixos.org/wiki/Flakes#Installing_flakes>`__.
|
|
|
|
|
|
|
|
Development Shell
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
We provide a `flake.nix` devshell that automatically sets up pre-commit hooks,
|
|
|
|
which allows for fast feedback cycles when making changes to the repository.
|
|
|
|
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
$ nix develop
|
|
|
|
|
|
|
|
|
|
|
|
We recommend setting up `direnv <https://direnv.net/>`__ to automatically
|
|
|
|
attach to the development environment when entering the project directories.
|
|
|
|
|
2020-07-06 22:23:03 +02:00
|
|
|
Run NixOS tests
|
|
|
|
---------------
|
2020-07-02 21:02:47 +02:00
|
|
|
|
2021-07-10 16:05:25 +02:00
|
|
|
To run the test suite, you need to enable `Nix Flakes
|
2025-05-08 18:32:21 +02:00
|
|
|
<https://wiki.nixos.org/wiki/Flakes#Installing_flakes>`__.
|
2021-07-10 16:05:25 +02:00
|
|
|
|
|
|
|
You can then run the testsuite via
|
|
|
|
|
|
|
|
::
|
|
|
|
|
|
|
|
$ nix flake check -L
|
|
|
|
|
|
|
|
Since Nix doesn't garantee your machine have enough resources to run
|
|
|
|
all test VMs in parallel, some tests can fail. You would then haev to
|
|
|
|
run tests manually. For instance:
|
2020-07-02 21:02:47 +02:00
|
|
|
|
|
|
|
::
|
|
|
|
|
2021-07-10 16:05:25 +02:00
|
|
|
$ nix build .#hydraJobs.x86_64-linux.external-unstable -L
|
|
|
|
|
2020-07-02 21:02:47 +02:00
|
|
|
|
2020-07-06 22:23:03 +02:00
|
|
|
Contributing to the documentation
|
|
|
|
---------------------------------
|
|
|
|
|
2022-12-01 14:22:27 +01:00
|
|
|
The documentation is written in RST (except option documentation which is in CommonMark),
|
2022-11-30 22:30:45 +01:00
|
|
|
built with Sphinx and published by `Read the Docs <https://readthedocs.org/>`_.
|
2020-07-06 22:23:03 +02:00
|
|
|
|
2022-12-01 14:22:27 +01:00
|
|
|
For the syntax, see the `RST/Sphinx primer
|
|
|
|
<https://www.sphinx-doc.org/en/master/usage/restructuredtext/basics.html>`_.
|
2020-07-06 22:23:03 +02:00
|
|
|
|
2022-12-01 14:22:27 +01:00
|
|
|
To build the documentation, you need to enable `Nix Flakes
|
2025-05-08 18:32:21 +02:00
|
|
|
<https://wiki.nixos.org/wiki/Flakes#Installing_flakes>`__.
|
2020-07-06 22:23:03 +02:00
|
|
|
|
2021-07-14 10:06:58 +02:00
|
|
|
|
|
|
|
::
|
|
|
|
|
2022-12-01 14:22:27 +01:00
|
|
|
$ nix build .#documentation
|
|
|
|
$ xdg-open result/index.html
|
2025-05-22 02:45:55 +02:00
|
|
|
|
|
|
|
|
|
|
|
Manual migrations
|
|
|
|
-----------------
|
|
|
|
|
|
|
|
We need to take great care around providing a migration story around breaking
|
|
|
|
changes. If manual intervention becomes necessary we provide the `stateVersion`
|
|
|
|
option to notify the user that they need to complete a migration before
|
|
|
|
they can deploy an update.
|
|
|
|
|
|
|
|
If that is the case for your change, find the highest `stateVersion` that is
|
|
|
|
being asserted on in `mail-server/assertions.nix`. Then pick the next number
|
|
|
|
and add a new assertion, write a good summary describing the issue and what
|
|
|
|
remediation steps are necessary. Finally reference the URL to the specific
|
|
|
|
section on the migration page in the documentation.
|
|
|
|
|
|
|
|
.. code-block:: nix
|
|
|
|
|
|
|
|
{
|
|
|
|
assertions = [
|
|
|
|
{
|
|
|
|
assertion = config.mailserver.stateVersion < 1;
|
|
|
|
message = ''
|
|
|
|
Problem: The home directory for the foobar service is snafu.
|
|
|
|
Remediation:
|
|
|
|
- Stop the `foobar.service`
|
|
|
|
- Rename `/var/lib/foobaz` to `/var/lib/foobar`
|
|
|
|
- Increase the `mailserver.stateVersion` to 1.
|
|
|
|
|
|
|
|
Check https://nixos-mailserver.readthedocs.io/en/latest/migrations.html#specific-anchor-here for further details.
|
|
|
|
'';
|
|
|
|
}
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
The setup guide should always reference the latest `stateVersion`, since we
|
|
|
|
don't require any migration steps for new setups.
|
|
|
|
|
|
|
|
The migration documentation should paint a more complete picture about the steps
|
|
|
|
that need to be carried out and why this has become necessary. Make sure to
|
|
|
|
reference the correct anchor in the URL you put into the assertion message.
|