all repos

dotfiles @ master

my dotfiles

nix/modules/soju.nix (view raw)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
{ ... }:
let
  domain = "irc.olexsmir.xyz";
in
{
  networking.firewall.allowedTCPPorts = [ 6697 ];
  services.caddy = {
    virtualHosts.${domain}.extraConfig = ''
      respond "irc bouncer"
    '';
    globalConfig = ''
      layer4 {
        :6697 {
          route {
            tls {
              connection_policy {
                alpn http/1.1 http/1.0 irc
                default_sni ${domain}
              }
            }
            proxy {
              proxy_protocol v2
              upstream localhost:6667
            }
          }
        }
      }
    '';
  };

  services.soju = {
    enable = true;
    hostName = domain;
    listen = [ "irc+insecure://localhost:6667" ];
    acceptProxyIP = [ "localhost" ];
  };
}