2024-11-17 00:08:02 +01:00
|
|
|
{ config, fp, 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" = {
|
2024-11-17 00:08:02 +01:00
|
|
|
sopsFile = fp /secrets/bicep/bicep.yaml;
|
2024-08-15 23:22:00 +02:00
|
|
|
key = "calendar-bot/matrix_token";
|
|
|
|
owner = cfg.user;
|
|
|
|
group = cfg.group;
|
|
|
|
};
|
|
|
|
"calendar-bot/mysql_password" = {
|
2024-11-17 00:08:02 +01:00
|
|
|
sopsFile = fp /secrets/bicep/bicep.yaml;
|
2024-08-15 23:22:00 +02:00
|
|
|
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
|
|
|
};
|
|
|
|
};
|
|
|
|
}
|