2 { pkgs, lib, config, ... }:
3 let inherit (config) networking;
4 inherit (config.services) nginx public-inbox;
9 virtualHosts."${srv}" = {
10 serverName = "${srv}.${domain}";
13 #root = "/home/julm/work/sourcephile/txt";
15 access_log ${nginx.logDir}/${domain}/${srv}/access.log json buffer=32k;
16 error_log ${nginx.logDir}/${domain}/${srv}/error.log warn;
18 locations."/".return = "302 /archives";
19 locations."= /archives".return = "302 /archives/";
20 locations."/archives".proxyPass = "http://unix:${builtins.head public-inbox.http.listenStreams}:/archives";
21 locations."= /style/light.css".alias = pkgs.writeText "light.css" ''
22 * { background:#fff; color:#000 }
24 a { color:#00f; text-decoration:none }
25 a:visited { color:#808 }
34 .hl.num { color:#f30 } /* number */
35 .hl.esc { color:#f0f } /* escape character */
36 .hl.str { color:#f30 } /* string */
37 .hl.ppc { color:#c3c } /* preprocessor */
38 .hl.pps { color:#f30 } /* preprocessor string */
39 .hl.slc { color:#099 } /* single-line comment */
40 .hl.com { color:#099 } /* multi-line comment */
41 /* .hl.opt { color:#ccc } */ /* operator */
42 /* .hl.ipl { color:#ccc } */ /* interpolation */
44 /* keyword groups kw[a-z] */
45 .hl.kwa { color:#f90 }
46 .hl.kwb { color:#060 }
47 .hl.kwc { color:#f90 }
48 /* .hl.kwd { color:#ccc } */
52 systemd.services.nginx.preStart = lib.mkBefore ''
53 install -D -d -m 750 -o ${nginx.user} -g ${nginx.group} ${nginx.logDir}/${domain}/${srv}/