Files
cnix/modules/home/services/hypridle/default.nix
2025-10-15 19:38:47 +02:00

34 lines
680 B
Nix

{
osConfig,
lib,
...
}: let
inherit (lib) mkIf;
cfg = osConfig.nixos.programs.hyprland;
in {
config = mkIf cfg.enable {
services.hypridle = {
enable = true;
settings = {
general = {
lock_cmd = "hyprlock";
before_sleep_cmd = "$lock_cmd";
after_sleep_cmd = "hyprctl dispatch dpms on";
};
listener = [
{
timeout = 900; # 15mins
on-timeout = "hyprlock";
}
{
timeout = 1200; # 20mins
on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on";
}
];
};
};
};
}