diff --git a/nixos/modules/services/mail/stalwart-mail.nix b/nixos/modules/services/mail/stalwart-mail.nix index 34004da62ef7..059addd617ba 100644 --- a/nixos/modules/services/mail/stalwart-mail.nix +++ b/nixos/modules/services/mail/stalwart-mail.nix @@ -154,8 +154,8 @@ in ]; systemd = { - packages = [ cfg.package ]; services.stalwart-mail = { + description = "Stalwart Mail Server"; wantedBy = [ "multi-user.target" ]; after = [ "local-fs.target" @@ -173,15 +173,21 @@ in ''; serviceConfig = { + # Upstream service config + Type = "simple"; + LimitNOFILE = 65536; + KillMode = "process"; + KillSignal = "SIGINT"; + Restart = "on-failure"; + RestartSec = 5; + SyslogIdentifier = "stalwart-mail"; + ExecStart = [ "" "${lib.getExe cfg.package} --config=${configFile}" ]; LoadCredential = lib.mapAttrsToList (key: value: "${key}:${value}") cfg.credentials; - StandardOutput = "journal"; - StandardError = "journal"; - ReadWritePaths = [ cfg.dataDir ]; @@ -228,7 +234,6 @@ in UMask = "0077"; }; unitConfig.ConditionPathExists = [ - "" "${configFile}" ]; };