{ pkgs, ... }: { services.swayidle = { enable = true; systemdTarget = "graphical-session.target"; events = [ { event = "before-sleep"; command = "${pkgs.swaylock}/bin/swaylock -f -i /tmp/lockpaper.jpg"; } ]; timeouts = [ { timeout = 600; command = "${pkgs.swaylock}/bin/swaylock -f -i /tmp/lockpaper.jpg"; } ]; }; }