2 { pkgs, lib, config, ... }:
4 inherit (config) networking;
5 inherit (config.security) gnupg;
6 inherit (config.services) nginx;
8 root = "/var/lib/nginx/${domain}";
11 systemd.services.nginx.serviceConfig = {
13 "/home/julm/work/perso:${root}/julm"
16 "nginx/${domain}/julm"
18 LogsDirectory = lib.mkForce [
19 "nginx/${domain}/${srv}"
23 virtualHosts."${domain}.${srv}" = {
24 serverAliases = [ domain ];
27 root = "${root}/${srv}";
29 access_log /var/log/nginx/${domain}/${srv}/access.log json buffer=32k;
30 error_log /var/log/nginx/${domain}/${srv}/error.log warn;
32 locations."/".extraConfig = ''
35 fancyindex_name_length 255;
36 fancyindex_exact_size off;
38 locations."/julm/" = {
39 alias = "${root}/julm/";
44 locations."/julm/PC/" = {
45 alias = "${root}/julm/PC/";
46 basicAuthFile = gnupg.secrets."nginx/${domain}/${srv}/julm/PC/htpasswd".path;
49 fancyindex_name_length 255;
50 fancyindex_exact_size off;
55 security.gnupg.secrets = {
56 "nginx/${domain}/${srv}/julm/PC/htpasswd" = {
57 # Generated with: echo "$user:$(openssl passwd -apr1)"
58 systemdConfig.before = [ "nginx.service" ];
59 systemdConfig.wantedBy = [ "nginx.service" ];