2 { pkgs, lib, config, ... }:
3 let inherit (config) networking;
4 inherit (config.services) nginx;
9 virtualHosts."${srv}" = {
10 serverName = "${srv}.${domain}";
11 serverAliases = [ domain ];
14 root = "/home/julm/work/sourcephile/txt";
16 access_log ${nginx.logDir}/${domain}/${srv}/access.log json buffer=32k;
17 error_log ${nginx.logDir}/${domain}/${srv}/error.log warn;
19 locations."/".extraConfig = ''
22 fancyindex_name_length 255;
23 fancyindex_exact_size off;
25 locations."/git".return = "302 http://git.${domain}";
26 locations."/codes_sources".return = "302 http://git.${domain}";
29 systemd.services.nginx.preStart = lib.mkBefore ''
30 install -D -d -m 750 -o ${nginx.user} -g ${nginx.group} ${nginx.logDir}/${domain}/${srv}/