fix: better email config, now with dns records

Deals with #32
This commit is contained in:
silver 2023-10-13 11:21:26 +01:00
parent 19a7476278
commit bea98fc9fc
3 changed files with 26 additions and 4 deletions

View file

@ -88,6 +88,11 @@
; ------------------------------------------
${format_records (filter_records_type "TXT") 29}
; ------------------------------------------
; MX
; ------------------------------------------
${format_records (filter_records_type "MX") 29}
; ------------------------------------------
; SRV
; ------------------------------------------
@ -317,7 +322,7 @@ in {
type = str;
};
r_type = lib.mkOption {
type = enum ["A" "CNAME" "TXT" "PTR" "SRV"];
type = enum ["A" "CNAME" "TXT" "PTR" "SRV" "MX"];
};
value = lib.mkOption {
type = str;

View file

@ -126,7 +126,7 @@ in {
{
record = "${cfg.domain}.";
r_type = "TXT";
value = ''"v=spf1 a:${cfg.sub}.${cfg.domain} a:gitlab.skynet.ie -all"'';
value = ''"v=spf1 a:${cfg.sub}.${cfg.domain} -all"'';
}
# DKIM keys

View file

@ -109,8 +109,8 @@ in {
skynet_dns.records = [
{
record = cfg.domain.sub;
r_type = "CNAME";
value = cfg.host.name;
r_type = "A";
value = cfg.host.ip;
}
# for gitlab pages
{
@ -118,11 +118,28 @@ in {
r_type = "A";
value = cfg.host.ip;
}
# for email
{
record = "${cfg.domain.sub}";
r_type = "MX";
value = ''10 ${domain_full}.'';
}
{
record = cfg.host.ip;
r_type = "PTR";
value = "${cfg.domain.sub}.${cfg.domain.base}.${cfg.domain.tld}.";
}
{
record = "${domain_full}.";
r_type = "TXT";
value = ''"v=spf1 a:gitlab.skynet.ie -all"'';
}
{
record = "_dmarc.${domain_full}.";
r_type = "TXT";
value = ''"v=DMARC1; p=none"'';
}
];
networking.firewall.allowedTCPPorts = [