2 { pkgs, lib, config, ... }:
4 inherit (config) networking;
5 inherit (config.services) nginx public-inbox;
10 virtualHosts."${srv}" = {
11 serverName = "${srv}.${domain}";
12 serverAliases = [ "mails.${domain}" ];
15 #root = "/home/julm/work/sourcephile/txt";
17 access_log /var/log/nginx/${domain}/${srv}/access.log json buffer=32k;
18 error_log /var/log/nginx/${domain}/${srv}/error.log warn;
20 locations."/".return = "302 /inbox";
21 locations."= /inbox".return = "302 /inbox/";
22 #locations."/inbox".proxyPass = "http://127.0.0.1:${toString public-inbox.http.port}/inbox";
23 locations."/inbox".proxyPass = "http://unix:${public-inbox.http.port}:/inbox";
24 locations."= /style/light.css".alias = pkgs.writeText "light.css" ''
25 * { background:#fff; color:#000 }
27 a { color:#00f; text-decoration:none }
28 a:visited { color:#808 }
37 .hl.num { color:#f30 } /* number */
38 .hl.esc { color:#f0f } /* escape character */
39 .hl.str { color:#f30 } /* string */
40 .hl.ppc { color:#c3c } /* preprocessor */
41 .hl.pps { color:#f30 } /* preprocessor string */
42 .hl.slc { color:#099 } /* single-line comment */
43 .hl.com { color:#099 } /* multi-line comment */
44 /* .hl.opt { color:#ccc } */ /* operator */
45 /* .hl.ipl { color:#ccc } */ /* interpolation */
47 /* keyword groups kw[a-z] */
48 .hl.kwa { color:#f90 }
49 .hl.kwb { color:#060 }
50 .hl.kwc { color:#f90 }
51 /* .hl.kwd { color:#ccc } */
55 systemd.services.nginx.serviceConfig.LogsDirectory = lib.mkForce ["nginx/${domain}/${srv}"];