{ config, lib, pkgs, ... }: with lib; let cfg = config.modules.services.gamja; in { options.modules.services.gamja = { enable = mkEnableOption "gamja web IRC client"; domain = mkOption { type = types.str; }; realHost = mkOption { type = types.str; }; server = mkOption { type = types.str; }; }; config = mkIf cfg.enable { services.nginx.virtualHosts.${cfg.realHost} = { forceSSL = true; useACMEHost = cfg.domain; root = pkgs.gamja.override { gamjaConfig.server.url = "wss://${cfg.server}"; }; }; }; }