From 650d3615c377981f3825b4e3fd7a9866b7a1deea Mon Sep 17 00:00:00 2001 From: cy Date: Thu, 30 Jan 2025 10:51:47 -0500 Subject: [PATCH] init soju Signed-off-by: cy --- hosts/chunk/default.nix | 2 ++ modules/default.nix | 1 + modules/soju.nix | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 modules/soju.nix diff --git a/hosts/chunk/default.nix b/hosts/chunk/default.nix index 577e9b5..4bd50ed 100644 --- a/hosts/chunk/default.nix +++ b/hosts/chunk/default.nix @@ -206,4 +206,6 @@ }; virtualisation.oci-containers.backend = "podman"; environment.enableAllTerminfo = true; + + my.soju.enable = true; } diff --git a/modules/default.nix b/modules/default.nix index 070a96e..9780465 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -3,5 +3,6 @@ imports = [ ./backup.nix ./caddy.nix + ./soju.nix ]; } diff --git a/modules/soju.nix b/modules/soju.nix new file mode 100644 index 0000000..a7a62db --- /dev/null +++ b/modules/soju.nix @@ -0,0 +1,23 @@ +{ config, lib, ... }: +let + cfg = config.my.soju; +in +{ + options.my.soju = { + enable = lib.mkEnableOption "soju"; + }; + + config = lib.mkIf cfg.enable { + services.soju = { + enable = true; + # should be fine since caddy will provide TLS + listen = [ "irc+insecure://127.0.0.1:6667" ]; + hostName = "soju.cy7.sh"; + }; + + services.caddy.virtualHosts."soju.cy7.sh".extraConfig = '' + import common + reverse_proxy 127.0.0.1:6667 + ''; + }; +}