about summary refs log tree commit diff
path: root/modules/services/gamja.nix
blob: ed3cead378dfc29390a45579a2e741e96aa420cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{ 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}";
      };
    };
  };
}