diff --git a/modules/global/common.nix b/modules/global/common.nix new file mode 100644 index 0000000..5d07934 --- /dev/null +++ b/modules/global/common.nix @@ -0,0 +1,45 @@ +{ ... }: +{ + common = rec { + domain = "inx.moe"; + subdomain = subdomain: "${subdomain}.${domain}"; + + nginx = rec { + ssl-cert = { + enableACME = true; + acmeRoot = null; + }; + ssl-optional = ssl-cert // { + addSSL = true; + }; + ssl = ssl-cert // { + forceSSL = true; + }; + }; + + rsyncnet = rec { + account = "de3482"; + user = "${account}s1"; + host = "${account}.rsync.net"; + }; + + email = rec { + withUser = user: "${user}@${domain}"; + outgoingUser = "noreply"; + incomingUser = "incoming"; + outgoing = withUser outgoingUser; + incoming = withUser incomingUser; + withSubaddress = subaddress: "${outgoingUser}+${subaddress}@${domain}"; + + smtp = { + address = "smtp.purelymail.com"; + SSLTLS = 465; + STARTTLS = 587; + }; + imap = { + address = "imap.purelymail.com"; + port = 993; + }; + }; + }; +} diff --git a/modules/global/security.nix b/modules/global/security.nix index 77fc15f..57cdb3e 100644 --- a/modules/global/security.nix +++ b/modules/global/security.nix @@ -60,47 +60,4 @@ with lib; # For permission to access smtp password users.groups.smtp = { }; - - common = rec { - domain = "inx.moe"; - subdomain = subdomain: "${subdomain}.${domain}"; - - nginx = rec { - ssl-cert = { - enableACME = true; - acmeRoot = null; - }; - ssl-optional = ssl-cert // { - addSSL = true; - }; - ssl = ssl-cert // { - forceSSL = true; - }; - }; - - rsyncnet = rec { - account = "de3482"; - user = "${account}s1"; - host = "${account}.rsync.net"; - }; - - email = rec { - withUser = user: "${user}@${domain}"; - outgoingUser = "noreply"; - incomingUser = "incoming"; - outgoing = withUser outgoingUser; - incoming = withUser incomingUser; - withSubaddress = subaddress: "${outgoingUser}+${subaddress}@${domain}"; - - smtp = { - address = "smtp.purelymail.com"; - SSLTLS = 465; - STARTTLS = 587; - }; - imap = { - address = "imap.purelymail.com"; - port = 993; - }; - }; - }; }