Fix hanging on maddy update

This commit is contained in:
Natsu Kagami 2021-12-01 14:38:53 -05:00
parent c41c05f45a
commit 1820b0f958
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51
2 changed files with 10 additions and 3 deletions

View file

@ -18,6 +18,8 @@ in
options.cloud.mail = {
enable = mkEnableOption "Enable the email server";
debug = mkEnableOption "Enable debugging";
package = mkOption {
type = types.package;
default = pkgs.maddy;
@ -275,7 +277,7 @@ in
serviceConfig = {
Type = "notify";
NotifyAccess = "main";
NotifyAccess = "exec";
User = name;
Group = name;
@ -335,9 +337,13 @@ in
Restart = "on-failure";
# ... Unless it is a configuration problem.
RestartPreventExitStatus = 2;
ExecStart = "${cfg.package}/bin/maddy ${if cfg.debug then "-debug " else ""}-config ${configFile}";
};
script = "${cfg.package}/bin/maddy -config ${configFile}";
reload = "/bin/kill -USR1 $MAINPID";
reload = ''
/bin/kill -USR1 $MAINPID
/bin/kill -USR2 $MAINPID
'';
};
};
}

View file

@ -60,6 +60,7 @@
sops.secrets.mail-users = { owner = "maddy"; };
cloud.mail = {
enable = true;
debug = true;
tls.certFile = "${config.cloud.traefik.certsDumper.destination}/${config.cloud.mail.hostname}/certificate.crt";
tls.keyFile = "${config.cloud.traefik.certsDumper.destination}/${config.cloud.mail.hostname}/privatekey.key";
usersFile = config.sops.secrets.mail-users.path;