services specialArg stage 1

This commit is contained in:
kat witch 2021-08-06 23:11:46 +01:00
parent aef9c37ee6
commit 3c9475cdcf
No known key found for this signature in database
GPG key ID: 1B477797DCA5EC72
30 changed files with 14 additions and 103 deletions

View file

@ -0,0 +1,61 @@
{ config, lib, tf, pkgs, sources, ... }:
with lib;
{
imports = [ sources.nixos-mailserver.outPath ];
deploy.tf.variables.domainkey_kitty = {
type = "string";
value.shellCommand = "bitw get infra/domainkey-kitty";
};
deploy.tf.dns.records.services_mail_mx = {
tld = config.kw.dns.tld;
domain = "@";
mx = {
priority = 10;
target = "${config.networking.hostName}.${config.kw.dns.tld}";
};
};
deploy.tf.dns.records.services_mail_spf = {
tld = config.kw.dns.tld;
domain = "@";
txt.value = "v=spf1 ip4:${config.kw.dns.ipv4} ip6:${config.kw.dns.ipv6} -all";
};
deploy.tf.dns.records.services_mail_dmarc = {
tld = config.kw.dns.tld;
domain = "_dmarc";
txt.value = "v=DMARC1; p=none";
};
deploy.tf.dns.records.services_mail_domainkey = {
tld = config.kw.dns.tld;
domain = "mail._domainkey";
txt.value = tf.variables.domainkey_kitty.ref;
};
mailserver = {
enable = true;
fqdn = "${config.networking.hostName}.${config.kw.dns.domain}";
domains = [ "kittywit.ch" "dork.dev" ];
# Use Let's Encrypt certificates. Note that this needs to set up a stripped
# down nginx and opens port 80.
certificateScheme = 3;
# Enable IMAP and POP3
enableImap = true;
enablePop3 = true;
enableImapSsl = true;
enablePop3Ssl = true;
# Enable the ManageSieve protocol
enableManageSieve = true;
# whether to scan inbound emails for viruses (note that this requires at least
# 1 Gb RAM for the server. Without virus scanning 256 MB RAM should be plenty)
virusScanning = false;
};
}