nix machine / user configurations
1{ 2 pkgs, 3 lib, 4 ... 5}: 6{ 7 home.packages = with pkgs; [ 8 wlopm 9 swayidle 10 ]; 11 services.swayidle = { 12 enable = true; 13 events = [ 14 { 15 event = "before-sleep"; 16 command = "swaylock"; 17 } 18 { 19 event = "lock"; 20 command = "swaylock"; 21 } 22 ]; 23 timeouts = [ 24 { 25 timeout = 120; 26 command = "wlopm --off \*"; 27 resumeCommand = "wlopm --on \*"; 28 } 29 { 30 timeout = 300; 31 command = "loginctl lock-session"; 32 } 33 ]; 34 }; 35 systemd.user.services.swayidle.Install.WantedBy = lib.mkForce [ "hyprland-session.target" ]; 36}