From 5f8f0bcb5facfdc52d051a39f8a4f842be572f01 Mon Sep 17 00:00:00 2001 From: alexion Date: Sun, 11 Oct 2026 17:19:05 -0400 Subject: [PATCH] refactor(hypridle): inline idle timeout --- .../desktop/session/hyprland/hypridle.nix | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/configs/nixos/modules/desktop/session/hyprland/hypridle.nix b/configs/nixos/modules/desktop/session/hyprland/hypridle.nix index a16cf27..7aae030 100644 --- a/configs/nixos/modules/desktop/session/hyprland/hypridle.nix +++ b/configs/nixos/modules/desktop/session/hyprland/hypridle.nix @@ -6,8 +6,6 @@ }: # hypridle: idle-triggered locking and display power management. let - cfg = config.modules.desktop.session.hyprland.hypridle; # NOLINT(let_order) - # The guard drops the call when a locker is already up, so no idle trigger # stacks a second hyprlock over the first. lockCmd = "${pkgs.procps}/bin/pidof hyprlock || ${hyprlock}"; @@ -17,18 +15,10 @@ let in { - options.modules.desktop.session.hyprland.hypridle = { - enable = lib.mkEnableOption "hypridle idle management"; + options.modules.desktop.session.hyprland.hypridle.enable = + lib.mkEnableOption "hypridle idle management"; - lockTimeout = lib.mkOption { - type = lib.types.ints.positive; - default = 300; - description = "Seconds of inactivity before the screen locks."; - }; - - }; - - config = lib.mkIf cfg.enable { + config = lib.mkIf config.modules.desktop.session.hyprland.hypridle.enable { # Closing the lid suspends, and every suspend locks first through the # before_sleep_cmd below, so the lid always lands at a locked screen. services.logind.settings.Login.HandleLidSwitch = "suspend"; @@ -47,7 +37,7 @@ in listener = [ # Lock on idle. { - timeout = cfg.lockTimeout; + timeout = 300; on-timeout = "loginctl lock-session"; } ];