{ 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 ]; }; }