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