add timer
This commit is contained in:
@@ -11,6 +11,7 @@ in {
|
|||||||
./hardware-configuration.nix
|
./hardware-configuration.nix
|
||||||
./services/virtual.nix
|
./services/virtual.nix
|
||||||
./services/x.nix
|
./services/x.nix
|
||||||
|
./services/timer.nix
|
||||||
./services/sound.nix
|
./services/sound.nix
|
||||||
./programs/hyprland.nix
|
./programs/hyprland.nix
|
||||||
];
|
];
|
||||||
|
|||||||
18
services/timer.nix
Normal file
18
services/timer.nix
Normal 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;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user