42 lines
1.0 KiB
Nix
Raw Normal View History

2024-04-20 09:42:06 -04:00
{ config, lib, ... }:
2025-01-20 22:35:40 -05:00
let
2025-02-08 13:01:16 -05:00
inherit (config.nmasur.settings) hostnames;
cfg = config.nmasur.presets.services.thelounge;
2025-01-20 22:35:40 -05:00
in
2024-04-20 09:42:06 -04:00
{
2024-02-25 18:50:00 +00:00
2025-02-17 14:05:23 -05:00
options.nmasur.presets.services.thelounge.enable = lib.mkEnableOption "TheLounge IRC chat service";
2025-01-20 22:35:40 -05:00
config = lib.mkIf cfg.enable {
2024-02-25 18:50:00 +00:00
services.thelounge = {
public = false;
port = 9000;
extraConfig = {
reverseProxy = true;
maxHistory = 10000;
};
};
2024-02-25 19:03:58 +00:00
# Adding new users:
# nix shell nixpkgs#thelounge
# sudo su - thelounge -s /bin/sh -c "thelounge add myuser"
2024-02-25 18:50:00 +00:00
# Allow web traffic to Caddy
2025-02-17 14:05:23 -05:00
nmasur.presets.services.caddy.routes = [
2024-04-20 09:42:06 -04:00
{
2025-02-08 12:58:06 -05:00
match = [ { host = [ hostnames.irc ]; } ];
2024-04-20 09:42:06 -04:00
handle = [
{
handler = "reverse_proxy";
upstreams = [ { dial = "localhost:${builtins.toString config.services.thelounge.port}"; } ];
}
];
}
];
2024-02-25 18:50:00 +00:00
# Configure Cloudflare DNS to point to this machine
2025-02-08 12:58:06 -05:00
services.cloudflare-dyndns.domains = [ hostnames.irc ];
2024-02-25 18:50:00 +00:00
};
}