2 { pkgs, lib, config, ... }:
4 inherit (config) networking;
5 inherit (config.security) pass;
6 inherit (config.services) nginx;
11 virtualHosts."${srv}" = {
12 serverName = "${srv}.${domain}";
13 serverAliases = [ domain ];
14 listen = [ { addr = "0.0.0.0"; port = 8443; ssl = true; } ];
18 root = "/var/lib/nginx";
20 access_log /var/log/nginx/${domain}/${srv}/access.log json buffer=32k;
21 error_log /var/log/nginx/${domain}/${srv}/error.log warn;
23 locations."/".extraConfig = ''
26 locations."/julm".extraConfig = ''
29 fancyindex_exact_size off;
30 fancyindex_name_length 255;
32 locations."/sevy".extraConfig = ''
33 auth_basic "sevy's area";
34 auth_basic_user_file ${pass.secrets."nginx/sevy/htpasswd".path};
39 systemd.services.nginx = {
40 serviceConfig.LogsDirectory = lib.mkForce ["nginx/${domain}/${srv}"];
41 wants = [ pass.secrets."nginx/sevy/htpasswd".service ];
42 after = [ pass.secrets."nginx/sevy/htpasswd".service ];
44 security.pass.secrets."nginx/sevy/htpasswd" = {
45 # Generated with: echo "$user:$(openssl passwd -apr1)"