reNixos/hand7s/services/hypridle.nix
s0me1newithhand7s e897fb4e87
hand7s: migrate from ${pkgs}/bin/ paths to ${lib.getExe pkgs}
Signed-off-by: s0me1newithhand7s <117505144+s0me1newithhand7s@users.noreply.github.com>
2025-06-13 13:06:24 +03:00

40 lines
1.1 KiB
Nix

{
config,
pkgs,
lib,
...
}: {
services = {
hypridle = {
enable = lib.mkIf (
config.home.gui.sessionType == "Hyprland"
)
true;
settings = {
general = {
before_sleep_cmd = "${lib.getExe' pkgs.hyprland "hyprctl"} dispatch dpms off";
after_sleep_cmd = "${lib.getExe' pkgs.hyprland "hyprctl"} dispatch dpms on";
};
listener = [
{
timeout = 300;
on-timeout = "${lib.getExe pkgs.brightnessctl} -s set 10";
on-resume = "${lib.getExe pkgs.brightnessctl} -r";
}
{
timeout = 600;
on-timeout = "${lib.getExe pkgs.hyprlock}";
}
{
timeout = 900;
on-timeout = "${lib.getExe' pkgs.systemd "systemctl"} suspend";
}
];
};
};
};
}