2 { pkgs, lib, config, ... }:
4 inherit (config) networking;
5 inherit (config.security) gnupg;
6 inherit (config.services) nginx;
8 onion = "dfc66yn2fundui5yvq2ndx4nmcmbxpho4ji32tlc4cncrjvs2b5yu4id";
12 relay.onionServices."nginx/${domain}/${srv}" = {
13 secretKey = gnupg.secrets."tor/onion/${onion}/hs_ed25519_secret_key".path;
16 #{ port = 443; target = { port = 8443; }; }
19 "descriptor:x25519:2EZQ3AOZXERDVSN6WO5LNSCOIIPL2AT2A7KOS4ZIYNVQDR5EFM2Q" # julm
22 client.onionServices.${onion} = {
23 clientAuthorizations = [
24 gnupg.secrets."tor/auth/julm".path
28 security.gnupg.secrets."tor/onion/${onion}/hs_ed25519_secret_key" = {};
29 security.gnupg.secrets."tor/auth/julm" = {};
31 virtualHosts."${srv}" = {
32 serverName = "${srv}.${domain}";
33 serverAliases = [ domain "${onion}.onion" ];
35 { addr="127.0.0.1"; port = 80; ssl = false; }
36 { addr="[::1]"; port = 80; ssl = false; }
37 { addr="0.0.0.0"; port = 8443; ssl = true; }
38 { addr="[::]"; port = 8443; ssl = true; }
44 root = "/var/lib/nginx";
46 access_log /var/log/nginx/${domain}/${srv}/access.log json buffer=32k;
47 error_log /var/log/nginx/${domain}/${srv}/error.log warn;
49 locations."/".extraConfig = ''
52 locations."/julm".extraConfig = ''
55 fancyindex_exact_size off;
56 fancyindex_name_length 255;
58 locations."/sevy".extraConfig = ''
59 auth_basic "sevy's area";
60 auth_basic_user_file ${gnupg.secrets."nginx/sevy/htpasswd".path};
65 systemd.services.nginx = {
66 serviceConfig.LogsDirectory = lib.mkForce ["nginx/${domain}/${srv}"];
67 wants = [ gnupg.secrets."nginx/sevy/htpasswd".service ];
68 after = [ gnupg.secrets."nginx/sevy/htpasswd".service ];
70 security.gnupg.secrets."nginx/sevy/htpasswd" = {
71 # Generated with: echo "$user:$(openssl passwd -apr1)"