dovecot: use marker option as unit name migration indicator

In nixpkgs we expose `services.dovecot.hasNewUnitName` option that can be
safely inspected to understand that whether to use the `dovecot` systemd
service name instead of `dovecot2`.
This commit is contained in:
Martin Weinelt 2025-07-06 23:57:22 +02:00
parent 6004878dc6
commit d6d2053b80
No known key found for this signature in database
GPG key ID: 87C1E9888F856759
7 changed files with 89 additions and 45 deletions

View file

@ -16,11 +16,21 @@
{
config,
options,
pkgs,
lib,
...
}:
with (import ./common.nix {
inherit
config
options
lib
pkgs
;
});
with config.mailserver;
let
@ -107,7 +117,7 @@ in
systemd.services.activate-virtual-mail-users = {
wantedBy = [ "multi-user.target" ];
before = [ "dovecot2.service" ];
before = [ "${dovecotUnitName}.service" ];
serviceConfig = {
ExecStart = virtualMailUsersActivationScript;
};