modules/*/reboot: reduce window from 6 to 3 hours

This commit is contained in:
zowoq 2024-01-24 09:06:07 +10:00
parent eaf745de2a
commit 5cb6b93100
2 changed files with 4 additions and 4 deletions
modules
darwin/common
nixos/common

View file

@ -1,9 +1,9 @@
{
# reboot every sunday between 00:00 and 06:00
# reboot every sunday between 00:00 and 03:00
launchd.daemons.reboot = {
script = ''
date
/sbin/shutdown -r "+$(( $RANDOM % ( 6 * 60 ) ))"
/sbin/shutdown -r "+$(( $RANDOM % ( 3 * 60 ) ))"
'';
serviceConfig = {
StartCalendarInterval = [

View file

@ -12,9 +12,9 @@
${config.systemd.package}/bin/shutdown -r now
fi
'';
startAt = "0/6:00";
startAt = "0/3:00";
};
systemd.timers.reboot-after-update = {
timerConfig.RandomizedDelaySec = "6h";
timerConfig.RandomizedDelaySec = "3h";
};
}