1
0
nixfiles/hosts/web-2/chaosevents.nix

49 lines
1.1 KiB
Nix
Raw Permalink Normal View History

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" ];
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";
};
requires = [ "network-online.target" ];
2023-06-13 17:53:45 +02:00
after = [ "network-online.target" ];
};
}