move sway/hyprland autoSuspend settings to desktop module

This commit is contained in:
Aly Raffauf 2024-07-30 16:04:34 -04:00
parent d037323c60
commit 23febc1d6a
3 changed files with 8 additions and 14 deletions

View file

@ -39,7 +39,7 @@ in {
); );
beforeSleeps = beforeSleeps =
lib.optionals cfg.desktop.hyprland.autoSuspend lib.optionals cfg.desktop.autoSuspend
[ [
"before-sleep '${lib.getExe pkgs.playerctl} pause'" "before-sleep '${lib.getExe pkgs.playerctl} pause'"
"before-sleep '${lib.getExe pkgs.swaylock}'" "before-sleep '${lib.getExe pkgs.swaylock}'"

View file

@ -20,7 +20,7 @@ in {
); );
beforeSleeps = beforeSleeps =
lib.optionals cfg.desktop.sway.autoSuspend lib.optionals cfg.desktop.autoSuspend
[ [
"before-sleep '${lib.getExe pkgs.playerctl} pause'" "before-sleep '${lib.getExe pkgs.playerctl} pause'"
"before-sleep '${lib.getExe pkgs.swaylock}'" "before-sleep '${lib.getExe pkgs.swaylock}'"

View file

@ -107,6 +107,12 @@ in {
}; };
desktop = { desktop = {
autoSuspend = lib.mkOption {
description = "Whether to autosuspend on idle.";
default = cfg.desktop.hyprland.enable || cfg.desktop.sway.enable;
type = lib.types.bool;
};
hyprland = { hyprland = {
enable = lib.mkOption { enable = lib.mkOption {
description = "Hyprland with full desktop session components."; description = "Hyprland with full desktop session components.";
@ -114,12 +120,6 @@ in {
type = lib.types.bool; 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 { laptopMonitors = lib.mkOption {
description = "List of internal laptop monitors."; description = "List of internal laptop monitors.";
default = []; default = [];
@ -195,12 +195,6 @@ in {
type = lib.types.bool; 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 { randomWallpaper = lib.mkOption {
description = "Whether to enable random wallpaper script."; description = "Whether to enable random wallpaper script.";
default = cfg.desktop.sway.enable; default = cfg.desktop.sway.enable;