{ pkgs, ... }: { services.swayidle = { enable = true; events = [ { event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock"; } { event = "lock"; command = "${pkgs.swaylock}/bin/swaylock"; } ]; timeouts = [ { timeout = 300; command = "${pkgs.swaylock}/bin/swaylock"; } { timeout = 1200; command = "${pkgs.systemd}/bin/systemctl hibernate"; } ]; }; }