From 8eaf7ab93419943518038caf1a3429d8701453c0 Mon Sep 17 00:00:00 2001 From: Felix Albrigtsen Date: Wed, 29 May 2024 01:31:38 +0200 Subject: [PATCH] burnham: add thelounge and nginx --- hosts/burnham/configuration.nix | 3 +++ hosts/burnham/services/nginx.nix | 19 +++++++++++++++++++ hosts/burnham/services/thelounge.nix | 21 +++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 hosts/burnham/services/nginx.nix create mode 100644 hosts/burnham/services/thelounge.nix diff --git a/hosts/burnham/configuration.nix b/hosts/burnham/configuration.nix index 5842bf6..39f55ba 100644 --- a/hosts/burnham/configuration.nix +++ b/hosts/burnham/configuration.nix @@ -10,6 +10,9 @@ # Infrastructure ./services/wireguard.nix + # Other + ./services/thelounge.nix + ./services/nginx.nix ]; boot.loader.systemd-boot.enable = lib.mkForce false; diff --git a/hosts/burnham/services/nginx.nix b/hosts/burnham/services/nginx.nix new file mode 100644 index 0000000..e4f4a00 --- /dev/null +++ b/hosts/burnham/services/nginx.nix @@ -0,0 +1,19 @@ +{ config, values, ... }: +{ + services.nginx = { + enable = true; + enableReload = true; + + recommendedProxySettings = true; + recommendedTlsSettings = true; + recommendedGzipSettings = true; + recommendedOptimisation = true; + }; + + networking.firewall.allowedTCPPorts = [ 80 443 ]; + + security.acme = { + acceptTerms = true; + defaults.email = "felix@albrigtsen.it"; + }; +} diff --git a/hosts/burnham/services/thelounge.nix b/hosts/burnham/services/thelounge.nix new file mode 100644 index 0000000..ecfa4d8 --- /dev/null +++ b/hosts/burnham/services/thelounge.nix @@ -0,0 +1,21 @@ +{ config, pkgs, lib, ... }: +let + cfg = config.services.thelounge.extraConfig; + domain = "irc.home.feal.no"; +in { + services.thelounge = { + enable = true; + + extraConfig = { + public = false; + host = "127.0.1.2"; + port = 9000; + reverseProxy = true; + }; + }; + + services.nginx.virtualHosts.${domain} = { + locations."/".proxyPass = "http://${cfg.host}:${toString cfg.port}"; + }; +} +