add timer

This commit is contained in:
2025-11-04 10:25:04 +09:00
parent 87a00571f7
commit d94c786424
2 changed files with 19 additions and 0 deletions

18
services/timer.nix Normal file
View File

@@ -0,0 +1,18 @@
{ config, pkgs, ... }: {
systemd.services.auto-shutdown = {
description = "Automatic daily shutdown at 9:30 pm";
serviceConfig = {
Type = "oneshot";
ExecStart = [ "${pkgs.systemd}/bin/systemctl poweroff" ];
};
};
systemd.timers.auto-shutdown = {
description = "Timer for daily shutdown at 9:30 pm";
wantedBy = [ "timers.target" ];
timerConfig = {
OnCalendar = "21:40";
Persistent = true;
};
};
}