2 { pkgs, lib, config, ... }:
4 inherit (config) networking;
5 inherit (config.security) gnupg;
6 inherit (config.services) nginx;
8 root = "/var/lib/nginx";
9 onion = "dfc66yn2fundui5yvq2ndx4nmcmbxpho4ji32tlc4cncrjvs2b5yu4id";
13 relay.onionServices."nginx/${domain}/${srv}" = {
14 secretKey = gnupg.secrets."tor/onion/${onion}/hs_ed25519_secret_key".path;
17 #{ port = 443; target = { port = 8443; }; }
20 "descriptor:x25519:2EZQ3AOZXERDVSN6WO5LNSCOIIPL2AT2A7KOS4ZIYNVQDR5EFM2Q" # julm
23 client.onionServices.${onion} = {
24 clientAuthorizations = [
25 gnupg.secrets."tor/auth/julm".path
29 security.gnupg.secrets."tor/onion/${onion}/hs_ed25519_secret_key" = {};
30 security.gnupg.secrets."tor/auth/julm" = {};
32 virtualHosts."${srv}.${domain}" = {
33 serverAliases = [ domain "${onion}.onion" ];
40 access_log /var/log/nginx/${domain}/${srv}/access.log json buffer=32k;
41 error_log /var/log/nginx/${domain}/${srv}/error.log warn;
43 locations."/".extraConfig = ''
47 locations."/julm".extraConfig = ''
50 fancyindex_exact_size off;
51 fancyindex_name_length 255;
53 #open_file_cache_valid 1s;
55 locations."/sevy".extraConfig = ''
56 auth_basic "sevy's area";
57 auth_basic_user_file ${gnupg.secrets."nginx/sevy/htpasswd".path};
62 systemd.services.nginx = {
64 LogsDirectory = lib.mkForce ["nginx/${domain}/${srv}"];
66 "/home/julm/work/sourcephile/web:${root}/julm"
67 "/home/julm/dl:${root}/dl"
68 "/home/julm/work/sourcephile/haskell:${root}/haskell"
71 wants = [ gnupg.secrets."nginx/sevy/htpasswd".service ];
72 after = [ gnupg.secrets."nginx/sevy/htpasswd".service ];
74 security.gnupg.secrets."nginx/sevy/htpasswd" = {
75 # Generated with: echo "$user:$(openssl passwd -apr1)"