blob: cc741790be9bbab2970fe69e26c5b491a321938e (
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
{
config,
lib,
pkgs,
modulesPath,
...
}: {
imports = [];
options.x = {
zulip = {
enable = true;
admin_email = lib.mkOption {
type = lib.types.str;
default = "admin+zulip@${config.networking.domain}";
};
integration = {
persistance.enable = lib.mkOption {
type = lib.types.bool;
description = "whether persistance is enabled";
default = lib.mkDefault false;
};
mailserver.enable = lib.mkOption {
type = lib.types.bool;
description = "creates simple-nixos-mailserver login automatically for admin user";
};
};
};
};
config = let
cfg = config.x.zulip;
in
lib.mkIf cfg.enable {
services.zulip = {
enable = true;
host = "zulip.${config.networking.domain}";
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;
zulipSettings = {
ZULIP_ADMINISTRATOR = cfg.admin_email;
EXTERNAL_HOST = "chat.${config.networking.domain}";
};
};
services.mailserver.loginAccounts = lib.mkIf cfg.integration.mailserver.enable {
"admin+zulip@${config.networking.domain}" = {
hashedPasswordFile = builtins.toString config.age.secrets.secret3.path;
};
};
};
}
|