modules/darwin: add reboot
This commit is contained in:
parent
b553120a3c
commit
e72543741f
2 changed files with 14 additions and 0 deletions
modules/darwin/common
|
@ -2,6 +2,7 @@
|
|||
{
|
||||
imports = [
|
||||
./flake-inputs.nix
|
||||
./reboot.nix
|
||||
./telegraf.nix
|
||||
../../shared/nix-daemon.nix
|
||||
];
|
||||
|
|
13
modules/darwin/common/reboot.nix
Normal file
13
modules/darwin/common/reboot.nix
Normal 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;
|
||||
}
|
||||
];
|
||||
};
|
||||
}
|
Loading…
Add table
Reference in a new issue