diff --git a/home/modules/hyprland/hypridle.nix b/home/modules/hyprland/hypridle.nix index c4d6048..dd65e53 100644 --- a/home/modules/hyprland/hypridle.nix +++ b/home/modules/hyprland/hypridle.nix @@ -14,18 +14,18 @@ in } listener { - timeout = 600 + timeout = ${toString cfg.hypridle.lockTimeout} on-timeout = "hyprlock" } listener { - timeout = 660 + timeout = ${toString cfg.hypridle.dpmsTimeout} on-timeout = hyprctl dispatch dpms off on-resume = hyprctl dispatch dpms on } listener { - timeout = 1800 + timeout = ${toString cfg.hypridle.suspendTimeout} on-timeout = systemctl suspend } ''; diff --git a/options/hyprland.nix b/options/hyprland.nix index b0b52f7..62a5de2 100644 --- a/options/hyprland.nix +++ b/options/hyprland.nix @@ -1,4 +1,4 @@ -{ lib, ... }: +{ lib, config, ... }: let types = lib.types; in @@ -49,6 +49,24 @@ in }; }; + hypridle = { + lockTimeout = lib.mkOption { + type = lib.types.int; + default = 600; + description = ''Time in seconds before the screen locks''; + }; + dpmsTimeout = lib.mkOption { + type = lib.types.int; + default = config.profile.hyprland.hypridle.lockTimeout + 60; + description = ''Time in seconds before the screen turns off. default is lockTimeout + 60''; + }; + suspendTimeout = lib.mkOption { + type = lib.types.int; + default = 1800; + description = ''Time in seconds before the system suspends. default is 30 minutes (1800 seconds)''; + }; + }; + dunst.monitor = lib.mkOption { type = lib.types.str; default = "0";