Introduce stateVersion concept

With upcoming changes to the dovecot home and maildirectories we need to
introduce a way to nudge users to inform themselves about manual
migration steps they might need to carry out.

The idea here is to allow us to safely make breaking changes and notify
the user of required migration steps at eval time, so they can make the
necessary changes in time.
This commit is contained in:
Martin Weinelt 2025-05-22 02:45:55 +02:00
parent f7a221bc69
commit 792225e256
No known key found for this signature in database
GPG key ID: 87C1E9888F856759
9 changed files with 100 additions and 4 deletions

View file

@ -25,6 +25,22 @@ in
options.mailserver = {
enable = mkEnableOption "nixos-mailserver";
stateVersion = mkOption {
type = types.nullOr types.ints.positive;
default = null;
description = ''
Tracking stateful version changes as an incrementing number.
When a new release comes out we may require manual migration steps to
be completed, before the new version can be put into production.
If your `stateVersion` is too low one or multiple assertions may
trigger to give you instructions on what migrations steps are required
to continue. Increase the `stateVersion` as instructed by the assertion
message.
'';
};
openFirewall = mkOption {
type = types.bool;
default = true;