summaryrefslogtreecommitdiff
path: root/modules/nixos/zulip.nix
blob: ee063c339645f55348ccd8f98c09d0a28551c8f8 (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
27
28
29
30
31
32
{config, ...}: {
  services.zulip = {
    enable = true;

    # lets it set up my postgresql for me
    enablePostgresqlLocally = true;

    # host domain
    host = "chat.${config.networking.domain}";

    # secrets
    camoKeyFile = builtins.toString config.age.secrets.zulip-camoKey.path;
    rabbitmqPasswordFile = builtins.toString config.age.secrets.zulip-rabbitmqPassword.path;
    secretKeyFile = builtins.toString config.age.secrets.zulip-secretKey.path;
    sharedSecretKeyFile = builtins.toString config.age.secrets.zulip-sharedSecretKey.path;
    avatarSaltKeyFile = builtins.toString config.age.secrets.zulip-avatarSaltKey.path;
    extraSecrets = {
      email_password = builtins.toString config.age.secrets.zulip-extraSecrets-email_password.path;
    };

    # settings
    zulipSettings = rec {
      EMAIL_USE_TLS = true;
      EMAIL_PORT = 587;
      ADD_TOKENS_TO_NOREPLY_ADDRESS = false;
      NOREPLY_EMAIL_ADDRESS = ZULIP_ADMINISTRATOR;
      OPEN_REALM_CREATION = true;
      EXTERNAL_HOST = config.services.zulip.host;
      ZULIP_ADMINISTRATOR = "admin@${config.networking.domain}";
    };
  };
}