char/topaz-flake
git clone https://git.t4t.associates/char/topaz-flake
d0b247a
main
1{ config , ...} : 2let 3domain = "soju.char.lt" ; 4cert = config . security . acme . certs .${ domain }; 5in 6{ 7services . nginx . virtualHosts .${ domain } = { 8enableACME = true ; 9locations . "/" . return = "404" ; 10}; 11 12# soju expects PROXY headers inside TLS, so terminate TLS before forwarding. 13services . nginx . streamConfig = '' 14server { 15listen 127.0.0.1:16698 ssl proxy_protocol; 16set_real_ip_from 127.0.0.1; 17ssl_certificate ${ cert . directory } /fullchain.pem; 18ssl_certificate_key ${ cert . directory } /key.pem; 19ssl_protocols TLSv1.2 TLSv1.3; 20proxy_pass 127.0.0.1:16699; 21proxy_protocol on; 22proxy_timeout 1h; 23} 24'' ; 25 26services . soju = { 27enable = true ; 28hostName = domain ; 29listen = [ "irc+insecure://127.0.0.1:16699" ]; 30acceptProxyIP = [ "127.0.0.1/32" ]; 31}; 32 33systemd . services . soju . serviceConfig = { 34StateDirectoryMode = "0700" ; 35RuntimeDirectoryMode = "0700" ; 36}; 37}