Reload dovecot2 on certificate update.
This commit is contained in:
parent
743830f7c6
commit
925cabde64
1 changed files with 28 additions and 24 deletions
|
@ -11,8 +11,7 @@ with lib;
|
|||
mailserver.nixosModules.mailserver
|
||||
];
|
||||
}
|
||||
// mkIf (elem "mailserver" config.machine.services) {
|
||||
mailserver =
|
||||
// mkIf (elem "mailserver" config.machine.services) (
|
||||
let
|
||||
cfg = config.machine;
|
||||
inherit (cfg) domain;
|
||||
|
@ -22,7 +21,7 @@ with lib;
|
|||
"${name}@${fdomain}"
|
||||
];
|
||||
mkExDomAlias = name: (map (exDom: "${name}@${exDom}") cfg.extraDomains);
|
||||
mkUser = user: rec {
|
||||
mkUser = user: {
|
||||
name = "${user.name}@${domain}";
|
||||
value = {
|
||||
hashedPasswordFile = config.sops.secrets."users/${user.name}/mail".path;
|
||||
|
@ -33,7 +32,8 @@ with lib;
|
|||
};
|
||||
};
|
||||
in
|
||||
rec {
|
||||
{
|
||||
mailserver = {
|
||||
enable = true;
|
||||
fqdn = fdomain;
|
||||
domains = [
|
||||
|
@ -63,5 +63,9 @@ with lib;
|
|||
# 1 Gb RAM for the server. Without virus scanning 256 MB RAM should be plenty)
|
||||
virusScanning = false;
|
||||
};
|
||||
systemd.services."acme-${fdomain}".serviceConfig.ExecStartPost = [
|
||||
"+systemctl reload dovecot2"
|
||||
];
|
||||
sops.secrets = fn.sopsHelper (user: "users/${user.name}/mail") config.machine.mailAccounts { };
|
||||
}
|
||||
)
|
||||
|
|
Loading…
Reference in a new issue