diff --git a/homeManagerModules/desktop/hyprland/scripts.nix b/homeManagerModules/desktop/hyprland/scripts.nix index 802023bf..04e9210e 100644 --- a/homeManagerModules/desktop/hyprland/scripts.nix +++ b/homeManagerModules/desktop/hyprland/scripts.nix @@ -39,7 +39,7 @@ in { ); beforeSleeps = - lib.optionals cfg.desktop.hyprland.autoSuspend + lib.optionals cfg.desktop.autoSuspend [ "before-sleep '${lib.getExe pkgs.playerctl} pause'" "before-sleep '${lib.getExe pkgs.swaylock}'" diff --git a/homeManagerModules/desktop/sway/scripts.nix b/homeManagerModules/desktop/sway/scripts.nix index 22652920..b49061ef 100644 --- a/homeManagerModules/desktop/sway/scripts.nix +++ b/homeManagerModules/desktop/sway/scripts.nix @@ -20,7 +20,7 @@ in { ); beforeSleeps = - lib.optionals cfg.desktop.sway.autoSuspend + lib.optionals cfg.desktop.autoSuspend [ "before-sleep '${lib.getExe pkgs.playerctl} pause'" "before-sleep '${lib.getExe pkgs.swaylock}'" diff --git a/homeManagerModules/options.nix b/homeManagerModules/options.nix index e6fb3754..53fb338e 100644 --- a/homeManagerModules/options.nix +++ b/homeManagerModules/options.nix @@ -107,6 +107,12 @@ in { }; desktop = { + autoSuspend = lib.mkOption { + description = "Whether to autosuspend on idle."; + default = cfg.desktop.hyprland.enable || cfg.desktop.sway.enable; + type = lib.types.bool; + }; + hyprland = { enable = lib.mkOption { description = "Hyprland with full desktop session components."; @@ -114,12 +120,6 @@ in { type = lib.types.bool; }; - autoSuspend = lib.mkOption { - description = "Whether to autosuspend on idle."; - default = cfg.desktop.hyprland.enable; - type = lib.types.bool; - }; - laptopMonitors = lib.mkOption { description = "List of internal laptop monitors."; default = []; @@ -195,12 +195,6 @@ in { type = lib.types.bool; }; - autoSuspend = lib.mkOption { - description = "Whether to autosuspend on idle."; - default = cfg.desktop.sway.enable; - type = lib.types.bool; - }; - randomWallpaper = lib.mkOption { description = "Whether to enable random wallpaper script."; default = cfg.desktop.sway.enable;