modules/darwin: add reboot

This commit is contained in:
zowoq 2023-07-21 20:12:20 +10:00
parent b553120a3c
commit e72543741f
2 changed files with 14 additions and 0 deletions
modules/darwin/common

View file

@ -2,6 +2,7 @@
{
imports = [
./flake-inputs.nix
./reboot.nix
./telegraf.nix
../../shared/nix-daemon.nix
];

View file

@ -0,0 +1,13 @@
{
# reboot every sunday between 00:00 and 06:00
launchd.daemons.reboot = {
command = ''/sbin/shutdown -r "+$(( $RANDOM % ( 6 * 60 ) ))"'';
serviceConfig.StartCalendarInterval = [
{
Hour = 0;
Minute = 0;
Weekday = 0;
}
];
};
}