diff options
| author | Grigory Shipunov | 2023-02-09 19:23:12 +0100 |
|---|---|---|
| committer | Grigory Shipunov | 2023-02-09 19:23:12 +0100 |
| commit | 3d823e8667404bf7fcb9f26628bce576b2faf460 (patch) | |
| tree | 3fedb46801cf2254b3ac9197cca1abf3401e594d /hosts | |
| parent | 69805fab21ffc665e8f85b77c01b565d1e3ddd7a (diff) | |
init: mrbouncy
Diffstat (limited to 'hosts')
| -rw-r--r-- | hosts/cirrus/irc.nix | 57 |
1 files changed, 39 insertions, 18 deletions
diff --git a/hosts/cirrus/irc.nix b/hosts/cirrus/irc.nix index 7262b99..6bda646 100644 --- a/hosts/cirrus/irc.nix +++ b/hosts/cirrus/irc.nix @@ -1,25 +1,46 @@ { pkgs, config, ... }: { - containers.irc = { - autoStart = true; - privateNetwork = true; - localAddress = "10.34.44.100/24"; + services.nginx = { + # reverse-proxy irc traffic on 7000 + streamConfig = '' + upstream soju { + server 127.0.0.1:6667; + } - config = { config, pkgs, ... }: { - services.soju = { - hostname = "mr_bouncy.oxapentane.com"; - enable = true; - enableMessageLogging = true; - acceptProxyIP = [ - "192.168.100.1" - ]; - }; + server { + listen 7000 ssl; + listen [::]:7000 ssl; - networking.firewall = { - enable = true; - allowedTCPPorts = [ 6697 22 ]; - }; + ssl_certificate /var/lib/acme/mrbouncy.oxapentane.com/fullchain.pem; + ssl_certificate_key /var/lib/acme/mrbouncy.oxapentane.com/key.pem; + ssl_trusted_certificate /var/lib/acme/mrbouncy.oxapentane.com/chain.pem; - system.stateVersion = "22.11"; + proxy_pass soju; + } + ''; + # just here to get the cert for irc reverse proxy + virtualHosts = { + "mrbouncy.oxapentane.com" = { + enableACME = true; + forceSSL = true; + locations = { + "/" = { + # no content for now, here just for no-boilerplate cert + return = "204"; + }; + }; + }; }; }; + + services.soju = { + hostName = "mrbouncy.oxapentane.com"; + listen = [ "irc+insecure://127.0.0.1:6667" ]; + enable = true; + enableMessageLogging = true; + acceptProxyIP = [ "localhost" ]; + }; + + environment.systemPackages = [ pkgs.soju ]; # expose soju mgmt commands + + networking.firewall.allowedTCPPorts = [ 7000 ]; } |
