stalwart: fix domain issues

This commit is contained in:
Bloxx12 2025-05-22 18:08:22 +02:00
commit c0aeed8ea4
Signed by: faukah
SSH key fingerprint: SHA256:Uj2AXqvtdCA4hn5Hq0ZonhIAyUqI1q4w2sMG3Z1TH7E

View file

@ -7,8 +7,8 @@
inherit (lib.modules) mkIf; inherit (lib.modules) mkIf;
inherit (lib.options) mkEnableOption; inherit (lib.options) mkEnableOption;
domain = "charlieroot.dev"; domain = "mail.charlieroot.dev";
acmeRoot = "/var/lib/acme/challenges-stalwart";
cfg = config.modules.system.services.stalwart; cfg = config.modules.system.services.stalwart;
in { in {
options.modules.system.services.stalwart.enable = mkEnableOption "stalwart"; options.modules.system.services.stalwart.enable = mkEnableOption "stalwart";
@ -27,7 +27,7 @@ in {
server = { server = {
# The default server hostname is utilized in SMTP EHLO commands, # The default server hostname is utilized in SMTP EHLO commands,
# as well as included in message headers and reports. # as well as included in message headers and reports.
hostname = "mail.${domain}"; hostname = domain;
tls = { tls = {
# Specifies whether the TLS encryption is available for the listener. # Specifies whether the TLS encryption is available for the listener.
enable = true; enable = true;
@ -66,7 +66,7 @@ in {
}; };
jmap = { jmap = {
bind = ["localhost::8080" "[::]:8080"]; bind = ["localhost::8080" "[::]:8080"];
url = "https://mail.${domain}"; url = "https://${domain}";
protocol = "jmap"; protocol = "jmap";
tls.implicit = true; tls.implicit = true;
}; };
@ -77,7 +77,7 @@ in {
}; };
}; };
lookup.default = { lookup.default = {
hostname = "mail.${domain}"; hostname = domain;
inherit domain; inherit domain;
}; };
}; };
@ -130,19 +130,5 @@ in {
}; };
}; };
}; };
security.acme = let
email = "charlie@charlieroot.dev";
in {
# testing server, do not use in production, but DO use it for setting things up.
# it has much higher rate limits.
# defaults.server = "https://acme-staging-v02.api.letsencrypt.org/directory";
certs = {
"mail.${domain}" = {
webroot = acmeRoot;
inherit email;
group = "nginx";
};
};
};
}; };
} }