Merge branch '#33_k9_mail_certs' into 'main'
added certs for k9 mail related subdomains See merge request compsoc1/skynet/nixos!25
This commit is contained in:
commit
0a89ac4526
2 changed files with 25 additions and 11 deletions
|
@ -9,16 +9,24 @@ with lib; let
|
||||||
in {
|
in {
|
||||||
imports = [];
|
imports = [];
|
||||||
|
|
||||||
options.skynet_acme = {
|
options = {
|
||||||
domains = lib.mkOption {
|
skynet_acme = {
|
||||||
default = [];
|
domains = lib.mkOption {
|
||||||
type = lib.types.listOf lib.types.str;
|
default = [];
|
||||||
description = ''
|
type = lib.types.listOf lib.types.str;
|
||||||
A list of domains to use for this server.
|
description = ''
|
||||||
'';
|
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 = {
|
config = {
|
||||||
# group that will own the certificates
|
# group that will own the certificates
|
||||||
users.groups.acme = {};
|
users.groups.acme = {};
|
||||||
|
@ -41,6 +49,10 @@ in {
|
||||||
domain = "skynet.ie";
|
domain = "skynet.ie";
|
||||||
extraDomainNames = cfg.domains;
|
extraDomainNames = cfg.domains;
|
||||||
};
|
};
|
||||||
|
"mail" = {
|
||||||
|
domain = "mail.skynet.ie";
|
||||||
|
extraDomainNames = cfg.domains_mail;
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -208,8 +208,10 @@ in {
|
||||||
|
|
||||||
age.secrets.ldap_pw.file = ../secrets/ldap/pw.age;
|
age.secrets.ldap_pw.file = ../secrets/ldap/pw.age;
|
||||||
|
|
||||||
skynet_acme.domains = [
|
skynet_acme.domains_mail = [
|
||||||
"${cfg.sub}.${cfg.domain}"
|
"imap.skynet.ie"
|
||||||
|
"pop3.skynet.ie"
|
||||||
|
"smtp.skynet.ie"
|
||||||
];
|
];
|
||||||
|
|
||||||
# set up dns record for it
|
# set up dns record for it
|
||||||
|
@ -307,7 +309,7 @@ in {
|
||||||
services.nginx.virtualHosts = {
|
services.nginx.virtualHosts = {
|
||||||
"${cfg.sub}.${cfg.domain}" = {
|
"${cfg.sub}.${cfg.domain}" = {
|
||||||
forceSSL = true;
|
forceSSL = true;
|
||||||
useACMEHost = "skynet";
|
useACMEHost = "mail";
|
||||||
# override the inbuilt nginx config
|
# override the inbuilt nginx config
|
||||||
enableACME = false;
|
enableACME = false;
|
||||||
serverName = "${cfg.sub}.${cfg.domain}";
|
serverName = "${cfg.sub}.${cfg.domain}";
|
||||||
|
|
Loading…
Reference in a new issue