From b2cfdc1fdf152bfb99490c6156b95f7eed9299d3 Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Sun, 25 Feb 2024 18:50:00 +0000 Subject: [PATCH] add thelounge irc client --- flake.nix | 1 + hosts/flame/default.nix | 1 + modules/common/default.nix | 4 ++++ modules/nixos/services/default.nix | 1 + modules/nixos/services/grafana.nix | 1 + modules/nixos/services/irc.nix | 28 ++++++++++++++++++++++++++++ 6 files changed, 36 insertions(+) create mode 100644 modules/nixos/services/irc.nix diff --git a/flake.nix b/flake.nix index cb811ce..9158d12 100644 --- a/flake.nix +++ b/flake.nix @@ -237,6 +237,7 @@ hostnames = { git = "git.${baseName}"; influxdb = "influxdb.${baseName}"; + irc = "irc.${baseName}"; metrics = "metrics.${baseName}"; prometheus = "prom.${baseName}"; paperless = "paper.${baseName}"; diff --git a/hosts/flame/default.nix b/hosts/flame/default.nix index a13c17b..722528f 100644 --- a/hosts/flame/default.nix +++ b/hosts/flame/default.nix @@ -59,6 +59,7 @@ inputs.nixpkgs.lib.nixosSystem { giteaRunner.enable = true; services.caddy.enable = true; services.grafana.enable = true; + services.thelounge.enable = true; services.openssh.enable = true; services.victoriametrics.enable = true; services.influxdb2.enable = true; diff --git a/modules/common/default.nix b/modules/common/default.nix index 3393144..b228e8f 100644 --- a/modules/common/default.nix +++ b/modules/common/default.nix @@ -107,6 +107,10 @@ type = lib.types.str; description = "Hostname for download services."; }; + irc = lib.mkOption { + type = lib.types.str; + description = "Hostname for IRC services."; + }; }; }; diff --git a/modules/nixos/services/default.nix b/modules/nixos/services/default.nix index fa22ac8..08561b7 100644 --- a/modules/nixos/services/default.nix +++ b/modules/nixos/services/default.nix @@ -11,6 +11,7 @@ ./calibre.nix ./cloudflare-tunnel.nix ./cloudflare.nix + ./irc.nix ./gitea-runner.nix ./gitea.nix ./gnupg.nix diff --git a/modules/nixos/services/grafana.nix b/modules/nixos/services/grafana.nix index fc4bfc7..3c20f6a 100644 --- a/modules/nixos/services/grafana.nix +++ b/modules/nixos/services/grafana.nix @@ -50,6 +50,7 @@ in { dashboards.settings.providers = [{ name = "test"; type = "file"; + allowUiUpdates = true; options.path = "${ (pkgs.writeTextDir "dashboards/dashboard.json" (builtins.toJSON { annotations = { diff --git a/modules/nixos/services/irc.nix b/modules/nixos/services/irc.nix new file mode 100644 index 0000000..f3373b4 --- /dev/null +++ b/modules/nixos/services/irc.nix @@ -0,0 +1,28 @@ +{ config, ... }: { + + config = { + + services.thelounge = { + public = false; + port = 9000; + extraConfig = { + reverseProxy = true; + maxHistory = 10000; + }; + }; + + # Allow web traffic to Caddy + caddy.routes = [{ + match = [{ host = [ config.hostnames.irc ]; }]; + handle = [{ + handler = "reverse_proxy"; + upstreams = [{ + dial = + "localhost:${builtins.toString config.services.thelounge.port}"; + }]; + }]; + }]; + + }; + +}