about summary refs log tree commit diff
path: root/modules/server/irc/znc/default.nix
blob: 056419ae492bdabf01fa853abd775092ff3634ee (plain) (blame)
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
{ config, pkgs, ... }:

{
  services.znc.enable = true;
  services.znc.useLegacyConfig = false;
  services.znc.modulePackages = with pkgs; [ zncModules.playback ];

  services.nginx.virtualHosts."znc.${config.networking.domain}" = {
    forceSSL = true;
    enableACME = true;

    locations = {
      "/" = {
        proxyPass = "http://127.0.0.1:6667/";
      };
    };
  };

  services.nginx.appendConfig = ''
    stream {
      server {
        listen 6697 ssl;
        ssl_certificate /var/lib/acme/${config.networking.domain}/fullchain.pem;
        ssl_certificate_key /var/lib/acme/${config.networking.domain}/key.pem;
        proxy_pass 127.0.0.1:6667;
      }
    }
  '';

  networking.firewall.allowedTCPPorts = [ 6697 ];
}