2022-06-22 15:51:22 +01:00
|
|
|
{ pkgs, ... }:
|
2022-07-27 16:47:49 +01:00
|
|
|
let
|
|
|
|
mail_config = (import ./config.nix { });
|
2022-06-22 15:51:22 +01:00
|
|
|
acmeRoot = "/var/lib/acme/acme-challenge";
|
|
|
|
|
|
|
|
in {
|
|
|
|
services.nginx = {
|
|
|
|
enable = true;
|
|
|
|
virtualHosts."${mail_config.fqdn}" = {
|
|
|
|
serverName = mail_config.fqdn;
|
|
|
|
serverAliases = mail_config.domains;
|
2022-06-22 18:05:02 +01:00
|
|
|
forceSSL = true;
|
2022-06-22 15:51:22 +01:00
|
|
|
enableACME = true;
|
2022-07-27 16:47:49 +01:00
|
|
|
acmeRoot = acmeRoot;
|
2022-06-22 15:51:22 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
security.acme.certs."${mail_config.fqdn}" = {
|
|
|
|
reloadServices = [ "postfix.service" "dovecot2.service" ];
|
|
|
|
};
|
|
|
|
}
|