2023-06-13 17:53:45 +02:00
|
|
|
{ pkgs, ... }:
|
|
|
|
|
|
|
|
{
|
|
|
|
users.users."chaosevents" = {
|
|
|
|
isSystemUser = true;
|
|
|
|
group = "chaosevents";
|
|
|
|
};
|
|
|
|
|
|
|
|
users.groups."chaosevents" = {};
|
|
|
|
|
|
|
|
systemd.tmpfiles.rules = [
|
|
|
|
"d /var/lib/chaosevents - chaosevents chaosevents - -"
|
|
|
|
];
|
|
|
|
|
|
|
|
services.nginx = {
|
|
|
|
virtualHosts."chaosevents.clerie.de" = {
|
|
|
|
enableACME = true;
|
|
|
|
forceSSL = true;
|
|
|
|
root = "/var/lib/chaosevents";
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.services."chaosevents" = {
|
|
|
|
wantedBy = [ "multi-user.target" ];
|
2024-03-24 14:20:34 +01:00
|
|
|
requires = [ "network.target" ];
|
2023-06-13 17:53:45 +02:00
|
|
|
after = [ "network.target" ];
|
|
|
|
serviceConfig = {
|
|
|
|
Type = "oneshot";
|
|
|
|
WorkingDirectory = "/var/lib/chaosevents";
|
2024-02-17 18:55:30 +01:00
|
|
|
RuntimeDirectory = "chaosevents";
|
2023-06-13 17:53:45 +02:00
|
|
|
User = "chaosevents";
|
|
|
|
Group = "chaosevents";
|
|
|
|
ExecStart = ''
|
|
|
|
${pkgs.chaosevents}/bin/chaosevents /var/lib/chaosevents
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
systemd.timers."chaosevents" = {
|
|
|
|
wantedBy = [ "timers.target" ];
|
|
|
|
timerConfig = {
|
|
|
|
OnCalendar = "hourly";
|
|
|
|
RandomizedDelaySec = "1h";
|
|
|
|
};
|
2024-03-24 14:20:34 +01:00
|
|
|
requires = [ "network-online.target" ];
|
2023-06-13 17:53:45 +02:00
|
|
|
after = [ "network-online.target" ];
|
|
|
|
};
|
|
|
|
}
|