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

47 lines
1.0 KiB
Nix

{ 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" ];
after = [ "network.target" ];
serviceConfig = {
Type = "oneshot";
WorkingDirectory = "/var/lib/chaosevents";
RuntimeDirectory = "chaosevents";
User = "chaosevents";
Group = "chaosevents";
ExecStart = ''
${pkgs.chaosevents}/bin/chaosevents /var/lib/chaosevents
'';
};
};
systemd.timers."chaosevents" = {
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "hourly";
RandomizedDelaySec = "1h";
};
after = [ "network-online.target" ];
};
}