feat: add zulip integration
This commit is contained in:
parent
50468db20b
commit
3a0d464234
14 changed files with 430 additions and 5 deletions
|
|
@ -5,6 +5,7 @@ let
|
|||
cfgCache = config.services.noisebell-cache;
|
||||
cfgRss = config.services.noisebell-rss;
|
||||
cfgDiscord = config.services.noisebell-discord;
|
||||
cfgZulip = config.services.noisebell-zulip;
|
||||
in
|
||||
{
|
||||
imports = [ agenix.nixosModules.default ];
|
||||
|
|
@ -14,6 +15,7 @@ in
|
|||
users.users.noisebell-cache.extraGroups = lib.mkIf cfgCache.enable [ "noisebell" ];
|
||||
users.users.noisebell-rss.extraGroups = lib.mkIf cfgRss.enable [ "noisebell" ];
|
||||
users.users.noisebell-discord.extraGroups = lib.mkIf cfgDiscord.enable [ "noisebell" ];
|
||||
users.users.noisebell-zulip.extraGroups = lib.mkIf cfgZulip.enable [ "noisebell" ];
|
||||
|
||||
age.secrets.noisebell-pi-to-cache-key = {
|
||||
file = "${self}/secrets/pi-to-cache-key.age";
|
||||
|
|
@ -33,20 +35,36 @@ in
|
|||
mode = "0440";
|
||||
};
|
||||
|
||||
age.secrets.noisebell-zulip-api-key = {
|
||||
file = "${self}/secrets/zulip-api-key.age";
|
||||
group = "noisebell";
|
||||
mode = "0440";
|
||||
};
|
||||
|
||||
age.secrets.noisebell-discord-webhook-secret = {
|
||||
file = "${self}/secrets/discord-webhook-secret.age";
|
||||
group = "noisebell";
|
||||
mode = "0440";
|
||||
};
|
||||
|
||||
age.secrets.noisebell-zulip-webhook-secret = {
|
||||
file = "${self}/secrets/zulip-webhook-secret.age";
|
||||
group = "noisebell";
|
||||
mode = "0440";
|
||||
};
|
||||
|
||||
services.noisebell-cache = lib.mkIf cfgCache.enable {
|
||||
piApiKeyFile = lib.mkDefault config.age.secrets.noisebell-cache-to-pi-key.path;
|
||||
inboundApiKeyFile = lib.mkDefault config.age.secrets.noisebell-pi-to-cache-key.path;
|
||||
outboundWebhooks = lib.mkDefault (
|
||||
lib.optional cfgDiscord.enable {
|
||||
(lib.optional cfgDiscord.enable {
|
||||
url = "http://127.0.0.1:${toString cfgDiscord.port}/webhook";
|
||||
secretFile = config.age.secrets.noisebell-discord-webhook-secret.path;
|
||||
}
|
||||
})
|
||||
++ (lib.optional cfgZulip.enable {
|
||||
url = "http://127.0.0.1:${toString cfgZulip.port}/webhook";
|
||||
secretFile = cfgZulip.webhookSecretFile;
|
||||
})
|
||||
);
|
||||
};
|
||||
|
||||
|
|
@ -66,4 +84,14 @@ in
|
|||
imageBaseUrl = lib.mkDefault "https://${cfgCache.domain}/image";
|
||||
}
|
||||
);
|
||||
|
||||
services.noisebell-zulip = lib.mkIf cfgZulip.enable (
|
||||
{
|
||||
apiKeyFile = lib.mkDefault config.age.secrets.noisebell-zulip-api-key.path;
|
||||
webhookSecretFile = lib.mkDefault config.age.secrets.noisebell-zulip-webhook-secret.path;
|
||||
}
|
||||
// lib.optionalAttrs cfgCache.enable {
|
||||
imageBaseUrl = lib.mkDefault "https://${cfgCache.domain}/image";
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue