From d1fd780e7963dcd8dd379bf7b3f1c2b6d884e383 Mon Sep 17 00:00:00 2001 From: clerie Date: Sun, 3 Jan 2021 15:19:40 +0100 Subject: [PATCH] Enable znc server --- hosts/web-2/configuration.nix | 1 + hosts/web-2/znc.nix | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 hosts/web-2/znc.nix diff --git a/hosts/web-2/configuration.nix b/hosts/web-2/configuration.nix index fdb179e..e497d71 100644 --- a/hosts/web-2/configuration.nix +++ b/hosts/web-2/configuration.nix @@ -8,6 +8,7 @@ ./bubblesort.nix ./ip.nix ./meow.nix + ./znc.nix ]; boot.loader.grub.enable = true; diff --git a/hosts/web-2/znc.nix b/hosts/web-2/znc.nix new file mode 100644 index 0000000..fa6cb09 --- /dev/null +++ b/hosts/web-2/znc.nix @@ -0,0 +1,29 @@ +{ ... }: + +{ + services.znc = { + enable = true; + mutable = true; + dataDir = "/var/lib/znc"; + configFile = "/var/lib/znc/configs/znc.conf"; + }; + + services.nginx.virtualHosts = { + "znc.clerie.de" = { + enableACME = true; + forceSSL = true; + locations."/" = { + proxyPass = "http://127.0.0.1:1313"; + }; + }; + }; + + clerie.nginx-port-forward = { + enable = true; + tcpPorts."6697" = { + host = "127.0.0.1"; + port = 1311; + certName = "znc.clerie.de"; + }; + }; +}