summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--custom/ymir-nginx.nix90
1 files changed, 44 insertions, 46 deletions
diff --git a/custom/ymir-nginx.nix b/custom/ymir-nginx.nix
index 3d2b7b4c..8df451fd 100644
--- a/custom/ymir-nginx.nix
+++ b/custom/ymir-nginx.nix
@@ -29,52 +29,46 @@ let
29 } 29 }
30 ''; 30 '';
31 31
32 mail-autoconfig = let 32 mail-autoconfig = pkgs.writeTextFile {
33 configXML = pkgs.writeTextFile { 33 name = "mail-autoconfig";
34 name = "mail-autoconfig"; 34 destination = "/config-v1.1.xml";
35 destination = "/config-v1.1.xml"; 35 text = ''
36 text = '' 36 <?xml version="1.0" encoding="UTF-8"?>
37 <?xml version="1.0" encoding="UTF-8"?> 37 <clientConfig version="1.1">
38 <clientConfig version="1.1"> 38 <emailProvider id="praseodym.org">
39 <emailProvider id="praseodym.org"> 39 <domain>141.li</domain>
40 <domain>141.li</domain> 40 <domain>xmpp.li</domain>
41 <domain>xmpp.li</domain> 41 <domain>yggdrasil.li</domain>
42 <domain>yggdrasil.li</domain> 42 <domain>praseodym.org</domain>
43 <domain>praseodym.org</domain> 43 <domain>kleen.li</domain>
44 <domain>kleen.li</domain> 44 <domain>nights.email</domain>
45 <domain>nights.email</domain> 45 <displayName>Praseodym</displayName>
46 <displayName>Praseodym</displayName> 46 <displayShortName>Praseodym</displayShortName>
47 <displayShortName>Praseodym</displayShortName> 47 <incomingServer type="imap">
48 <incomingServer type="imap"> 48 <hostname>ymir.yggdrasil.li</hostname>
49 <hostname>ymir.yggdrasil.li</hostname> 49 <port>143</port>
50 <port>143</port> 50 <socketType>STARTTLS</socketType>
51 <socketType>STARTTLS</socketType> 51 <authentication>password-cleartext</authentication>
52 <authentication>password-cleartext</authentication> 52 <username>%EMAILLOCALPART%</username>
53 <username>%EMAILLOCALPART%</username> 53 </incomingServer>
54 </incomingServer> 54 <outgoingServer type="smtp">
55 <outgoingServer type="smtp"> 55 <hostname>ymir.yggdrasil.li</hostname>
56 <hostname>ymir.yggdrasil.li</hostname> 56 <port>25</port>
57 <port>25</port> 57 <socketType>STARTTLS</socketType>
58 <socketType>STARTTLS</socketType> 58 <authentication>password-cleartext</authentication>
59 <authentication>password-cleartext</authentication> 59 <username>%EMAILLOCALPART%</username>
60 <username>%EMAILLOCALPART%</username> 60 </outgoingServer>
61 </outgoingServer> 61 <incomingServer type="imap">
62 <incomingServer type="imap"> 62 <hostname>ymir.yggdrasil.li</hostname>
63 <hostname>ymir.yggdrasil.li</hostname> 63 <port>993</port>
64 <port>993</port> 64 <socketType>SSL</socketType>
65 <socketType>SSL</socketType> 65 <authentication>password-cleartext</authentication>
66 <authentication>password-cleartext</authentication> 66 <username>%EMAILLOCALPART%</username>
67 <username>%EMAILLOCALPART%</username> 67 </incomingServer>
68 </incomingServer> 68 </emailProvider>
69 </emailProvider> 69 </clientConfig>
70 </clientConfig> 70 '';
71 ''; 71 };
72 };
73 in builtins.toFile "mail-autoconfig" ''
74 location /.well-known/autoconfig/mail {
75 root ${configXML};
76 }
77 '';
78in { 72in {
79 services.logrotate = { 73 services.logrotate = {
80 enable = true; 74 enable = true;
@@ -150,6 +144,10 @@ in {
150 include ${mail-autoconfig}; 144 include ${mail-autoconfig};
151 145
152 root /srv/www/default; 146 root /srv/www/default;
147
148 location /.well-known/autoconfig/mail {
149 root ${mail-autoconfig};
150 }
153 } 151 }
154 152
155 server { 153 server {