strukturbot: move to quitte

This commit is contained in:
Jonas Gaffke 2024-02-03 20:48:34 +01:00 committed by Rouven Seifert
parent 826758e138
commit 81a83d7989
Signed by: rouven.seifert
GPG key ID: B95E8FE6B11C4D09
2 changed files with 33 additions and 1 deletions

View file

@ -91,7 +91,7 @@
./modules/fsrewsp.nix
./modules/nightline.nix
./modules/decisions.nix
# ./modules/struktur-bot.nix
./modules/struktur-bot.nix
{
nixpkgs.overlays = [ self.overlays.default ];
sops.defaultSopsFile = ./secrets/quitte.yaml;

32
modules/struktur-bot.nix Normal file
View file

@ -0,0 +1,32 @@
{ config, pkgs, ... }:
{
sops.secrets."strukturbot_env" = { };
virtualisation.docker.daemon.settings.dns = ["141.30.1.1" "141.76.14.1"];
virtualisation.oci-containers = {
containers.struktur-bot = {
image = "struktur-bot";
environmentFiles = [
config.sops.secrets."strukturbot_env".path
];
extraOptions = [ "--network=host" ];
};
};
systemd.timers."overleaf-backup" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "02:22:00";
Unit = "overleaf-backup.service";
};
};
systemd.services."overleaf-backup" = {
script = ''
set -eu
${pkgs.docker}/bin/docker exec struktur-bot python3 backup.py
'';
serviceConfig = {
Type = "oneshot";
User = "root";
};
};
}