email: unfortunately undoes some of the work @esy did but I think this will work

#33
This commit is contained in:
silver 2023-10-26 02:30:42 +01:00
parent 0a89ac4526
commit eebf1845cb
2 changed files with 72 additions and 27 deletions

View file

@ -18,13 +18,6 @@ in {
A list of domains to use for this server.
'';
};
domains_mail = lib.mkOption {
default = [];
type = lib.types.listOf lib.types.str;
description = ''
A list of domains to use for the mailserver.
'';
};
};
};
config = {
@ -49,10 +42,6 @@ in {
domain = "skynet.ie";
extraDomainNames = cfg.domains;
};
"mail" = {
domain = "mail.skynet.ie";
extraDomainNames = cfg.domains_mail;
};
};
};
};

View file

@ -208,11 +208,78 @@ in {
age.secrets.ldap_pw.file = ../secrets/ldap/pw.age;
skynet_acme.domains_mail = [
"imap.skynet.ie"
"pop3.skynet.ie"
"smtp.skynet.ie"
];
security.acme.certs = {
"mail" = {
domain = "mail.skynet.ie";
extraDomainNames = [
"imap.skynet.ie"
"pop3.skynet.ie"
"smtp.skynet.ie"
];
};
"imap" = {
domain = "imap.skynet.ie";
extraDomainNames = [
"mail.skynet.ie"
"pop3.skynet.ie"
"smtp.skynet.ie"
];
};
"pop3" = {
domain = "pop3.skynet.ie";
extraDomainNames = [
"imap.skynet.ie"
"mail.skynet.ie"
"smtp.skynet.ie"
];
};
"smtp" = {
domain = "smtp.skynet.ie";
extraDomainNames = [
"imap.skynet.ie"
"pop3.skynet.ie"
"mail.skynet.ie"
];
};
};
# to provide the certs
services.nginx.virtualHosts = {
"mail.skynet.ie" = {
forceSSL = true;
useACMEHost = "mail";
# override the inbuilt nginx config
enableACME = false;
serverName = "mail.skynet.ie";
};
"imap.skynet.ie" = {
forceSSL = true;
useACMEHost = "imap";
# override the inbuilt nginx config
enableACME = false;
serverName = "imap.skynet.ie";
};
"pop3.skynet.ie" = {
forceSSL = true;
useACMEHost = "pop3";
# override the inbuilt nginx config
enableACME = false;
serverName = "pop3.skynet.ie";
};
"smtp.skynet.ie" = {
forceSSL = true;
useACMEHost = "smtp";
# override the inbuilt nginx config
enableACME = false;
serverName = "smtp.skynet.ie";
};
};
# set up dns record for it
skynet_dns.records = [
@ -305,17 +372,6 @@ in {
}
];
# to provide the certs
services.nginx.virtualHosts = {
"${cfg.sub}.${cfg.domain}" = {
forceSSL = true;
useACMEHost = "mail";
# override the inbuilt nginx config
enableACME = false;
serverName = "${cfg.sub}.${cfg.domain}";
};
};
#https://nixos-mailserver.readthedocs.io/en/latest/add-roundcube.html
users.groups.nginx = {};
users.groups.roundcube = {};