mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-08-11 05:42:33 +02:00
In particular, we were missing `sops-install-secrets.service` in a ton of places, and `network-online.target` for some homebrewn services. This has caused failure of some services on machine startup.
44 lines
1.1 KiB
Nix
44 lines
1.1 KiB
Nix
{ config, fp, lib, pkgs, ... }:
|
|
let
|
|
cfg = config.services.pvv-calendar-bot;
|
|
in {
|
|
sops.secrets = {
|
|
"calendar-bot/matrix_token" = {
|
|
sopsFile = fp /secrets/bicep/bicep.yaml;
|
|
key = "calendar-bot/matrix_token";
|
|
owner = cfg.user;
|
|
group = cfg.group;
|
|
};
|
|
"calendar-bot/mysql_password" = {
|
|
sopsFile = fp /secrets/bicep/bicep.yaml;
|
|
key = "calendar-bot/mysql_password";
|
|
owner = cfg.user;
|
|
group = cfg.group;
|
|
};
|
|
};
|
|
|
|
services.pvv-calendar-bot = {
|
|
enable = true;
|
|
|
|
settings = {
|
|
matrix = {
|
|
homeserver = "https://matrix.pvv.ntnu.no";
|
|
user = "@bot_calendar:pvv.ntnu.no";
|
|
channel = "!gkNLUIhYVpEyLatcRz:pvv.ntnu.no";
|
|
};
|
|
database = {
|
|
host = "mysql.pvv.ntnu.no";
|
|
user = "calendar-bot";
|
|
passwordFile = config.sops.secrets."calendar-bot/mysql_password".path;
|
|
};
|
|
secretsFile = config.sops.secrets."calendar-bot/matrix_token".path;
|
|
onCalendar = "*-*-* 09:00:00";
|
|
};
|
|
};
|
|
|
|
systemd.services.pvv-calendar-bot = {
|
|
after = [ "sops-install-secrets.service" ];
|
|
requires = [ "sops-install-secrets.service" ];
|
|
};
|
|
}
|