pvv-nixos-config/hosts/bicep/services/calendar-bot.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

39 lines
1020 B
Nix
Raw Normal View History

2023-08-27 02:36:01 +02:00
{ config, lib, pkgs, ... }:
2023-09-08 02:23:59 +02:00
let
cfg = config.services.pvv-calendar-bot;
in {
2024-08-15 23:22:00 +02:00
sops.secrets = {
"calendar-bot/matrix_token" = {
sopsFile = ../../../secrets/bicep/bicep.yaml;
key = "calendar-bot/matrix_token";
owner = cfg.user;
group = cfg.group;
};
"calendar-bot/mysql_password" = {
sopsFile = ../../../secrets/bicep/bicep.yaml;
key = "calendar-bot/mysql_password";
owner = cfg.user;
group = cfg.group;
};
2023-08-27 02:36:01 +02:00
};
services.pvv-calendar-bot = {
enable = true;
2023-09-08 02:23:59 +02:00
2023-08-27 02:36:01 +02:00
settings = {
matrix = {
homeserver = "https://matrix.pvv.ntnu.no";
user = "@bot_calendar:pvv.ntnu.no";
2023-09-08 02:23:59 +02:00
channel = "!gkNLUIhYVpEyLatcRz:pvv.ntnu.no";
2023-08-27 02:36:01 +02:00
};
2024-08-15 23:22:00 +02:00
database = {
host = "mysql.pvv.ntnu.no";
user = "calendar-bot";
passwordFile = config.sops.secrets."calendar-bot/mysql_password".path;
};
2023-08-27 02:36:01 +02:00
secretsFile = config.sops.secrets."calendar-bot/matrix_token".path;
2023-09-12 18:23:20 +02:00
onCalendar = "*-*-* 09:00:00";
2023-08-27 02:36:01 +02:00
};
};
}