libconfig for hypridle

This commit is contained in:
joygnu 2024-09-01 19:10:52 +02:00
parent 55f06c6a4f
commit 4526d9c757
2 changed files with 25 additions and 17 deletions

View file

@ -1,6 +1,5 @@
{ {
inputs, inputs,
pkgs,
... ...
}: { }: {
networking.hostName = "laptop"; networking.hostName = "laptop";
@ -8,6 +7,8 @@
boot.loader.systemd-boot.enable = true; boot.loader.systemd-boot.enable = true;
services.xserver.desktopManager.gnome.enable = true; services.xserver.desktopManager.gnome.enable = true;
hypridle.enable = true;
imports = [ imports = [
../../modules ../../modules
./hardware.nix ./hardware.nix

View file

@ -1,19 +1,26 @@
{...}: { {lib,config,...}: {
home-manager.users.joy.services.hypridle = { options = {
enable = true; hypridle.enable = lib.mkEnableOption "Enables kitty";
settings = { };
listener = [
{ config = lib.mkIf config.hypridle.enable {
timeout = 300; home-manager.users.joy.services.hypridle = {
on-timeout = "hyprctl dispatch dpms off"; enable = true;
on-resume = "hyprctl dispatch dpms on"; settings = {
} listener = [
{ {
timeout = 600; timeout = 300;
on-timeout = "systemctl suspend"; on-timeout = "hyprctl dispatch dpms off";
on-resume = "hyprctl dispatch dpms on"; on-resume = "hyprctl dispatch dpms on";
} }
]; {
timeout = 600;
on-timeout = "systemctl suspend";
on-resume = "hyprctl dispatch dpms on";
}
];
};
}; };
}; };
} }