Files
nixos/modules/services/weechat.nix
2025-05-26 09:38:56 +03:00

37 lines
710 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.services.weechat;
fqdn = cfg.subdomain + "." + config.networking.domain;
in
{
options.services.weechat = {
subdomain = lib.mkOption {
type = lib.types.str;
description = "The subdomain for the weechat service";
};
};
config = lib.mkIf cfg.enable {
services = {
weechat = {
# binary = lib.mkDefault "${pkgs.weechat}/bin/weechat-headless";
};
webserver = {
enable = lib.mkDefault true;
vHosts.${fqdn}.locations = {
"/".root = pkgs.glowing-bear;
"/weechat".proxyPort = 9001;
};
};
};
networking.firewall.allowedTCPPorts = [ 9001 ];
};
}