infra/modules/darwin/common/reboot.nix

21 lines
427 B
Nix
Raw Normal View History

2023-07-21 20:12:20 +10:00
{
# reboot every sunday between 00:00 and 03:00
2023-07-21 20:12:20 +10:00
launchd.daemons.reboot = {
2023-12-11 11:21:35 +10:00
script = ''
date
/sbin/shutdown -r "+$(( $RANDOM % ( 3 * 60 ) ))"
2023-12-11 11:21:35 +10:00
'';
serviceConfig = {
StartCalendarInterval = [
{
Hour = 0;
Minute = 0;
Weekday = 0;
}
];
StandardErrorPath = "/var/log/reboot.log";
StandardOutPath = "/var/log/reboot.log";
};
2023-07-21 20:12:20 +10:00
};
}