35 lines
919 B
Nix
35 lines
919 B
Nix
{
|
|
config,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.modules) mkIf mkForce;
|
|
|
|
mailConfig = config.services.mailserver;
|
|
in {
|
|
config = mkIf (mailConfig.enable && mailConfig.roundcube.enable) {
|
|
services.roundcube = {
|
|
enable = true;
|
|
package = mailConfig.roundcube.package;
|
|
plugins =
|
|
mailConfig.roundcube.plugins
|
|
++ [
|
|
"managesieve"
|
|
];
|
|
hostName = "${mailConfig.roundcube.domain}";
|
|
extraConfig = ''
|
|
$config['smtp_server'] = "tls://${mailConfig.fqdn}";
|
|
$config['smtp_user'] = "%u";
|
|
$config['smtp_pass'] = "%p";
|
|
$config['managesieve_host'] = 'tls://${mailConfig.fqdn}';
|
|
${mailConfig.roundcube.extraConfig}
|
|
'';
|
|
};
|
|
|
|
services.nginx.virtualHosts."${mailConfig.roundcube.domain}" = {
|
|
forceSSL = mkForce mailConfig.roundcube.forceSSL;
|
|
enableACME = mkForce mailConfig.roundcube.enableACME;
|
|
};
|
|
};
|
|
}
|