fix: zulip to use domain and webhooks api properly

This commit is contained in:
Jet 2026-03-23 22:45:49 -07:00
parent 3a0d464234
commit e2f2b96919
No known key found for this signature in database

View file

@ -10,8 +10,9 @@ in
enable = lib.mkEnableOption "noisebell Zulip bridge";
domain = lib.mkOption {
type = lib.types.str;
description = "Domain for the Caddy virtual host.";
type = lib.types.nullOr lib.types.str;
default = null;
description = "Optional domain for the Caddy virtual host.";
};
port = lib.mkOption {
@ -57,17 +58,14 @@ in
};
};
config = lib.mkIf cfg.enable {
config = lib.mkIf cfg.enable (
{
users.users.noisebell-zulip = {
isSystemUser = true;
group = "noisebell-zulip";
};
users.groups.noisebell-zulip = { };
services.caddy.virtualHosts.${cfg.domain}.extraConfig = ''
reverse_proxy localhost:${toString cfg.port}
'';
systemd.services.noisebell-zulip = {
description = "Noisebell Zulip bridge";
wantedBy = [ "multi-user.target" ];
@ -103,5 +101,11 @@ in
RestrictSUIDSGID = true;
};
};
};
}
// lib.mkIf (cfg.domain != null) {
services.caddy.virtualHosts.${cfg.domain}.extraConfig = ''
reverse_proxy localhost:${toString cfg.port}
'';
}
);
}