]> Git — Sourcephile - sourcephile-nix.git/blob - servers/mermet/nginx/sourcephile.fr/lemoutona5pattes.nix
nix: add julm to some meta.maintainers
[sourcephile-nix.git] / servers / mermet / nginx / sourcephile.fr / lemoutona5pattes.nix
1 { domain, ... }:
2 { pkgs, lib, config, ... }:
3 let inherit (config) networking;
4 inherit (config.services) nginx;
5 srv = "lemoutona5pattes";
6 in
7 {
8 services.nginx = {
9 virtualHosts."${srv}" = {
10 serverName = "${srv}.${domain}";
11 forceSSL = true;
12 useACMEHost = domain;
13 root = "/home/julm/www/${srv}";
14 extraConfig = ''
15 access_log ${nginx.logDir}/${domain}/${srv}/access.log json buffer=32k;
16 error_log ${nginx.logDir}/${domain}/${srv}/error.log warn;
17 '';
18 locations."/".extraConfig = ''
19 #autoindex on;
20 fancyindex on;
21 fancyindex_name_length 255;
22 fancyindex_exact_size off;
23 '';
24 };
25 };
26 systemd.services.nginx.preStart = lib.mkBefore ''
27 install -D -d -m 750 -o ${nginx.user} -g ${nginx.group} ${nginx.logDir}/${domain}/${srv}/
28 '';
29 }