2 { pkgs, lib, config, ... }:
4 inherit (config) networking;
5 inherit (config.security) gnupg;
6 inherit (config.services) nginx;
10 services.tor.hiddenServices."${domain}/${srv}".map = [
11 { port = 443; toPort = 8443; }
14 virtualHosts."${srv}" = {
15 serverName = "${srv}.${domain}";
16 serverAliases = [ domain ];
17 listen = [ { addr = "0.0.0.0"; port = 8443; ssl = true; } ];
21 root = "/var/lib/nginx";
23 access_log /var/log/nginx/${domain}/${srv}/access.log json buffer=32k;
24 error_log /var/log/nginx/${domain}/${srv}/error.log warn;
26 locations."/".extraConfig = ''
29 locations."/julm".extraConfig = ''
32 fancyindex_exact_size off;
33 fancyindex_name_length 255;
35 locations."/sevy".extraConfig = ''
36 auth_basic "sevy's area";
37 auth_basic_user_file ${gnupg.secrets."nginx/sevy/htpasswd".path};
42 systemd.services.nginx = {
43 serviceConfig.LogsDirectory = lib.mkForce ["nginx/${domain}/${srv}"];
44 wants = [ gnupg.secrets."nginx/sevy/htpasswd".service ];
45 after = [ gnupg.secrets."nginx/sevy/htpasswd".service ];
47 security.gnupg.secrets."nginx/sevy/htpasswd" = {
48 # Generated with: echo "$user:$(openssl passwd -apr1)"