26 lines
530 B
Nix
26 lines
530 B
Nix
{ pkgs, ... }:
|
|
{
|
|
services.swayidle = {
|
|
enable = true;
|
|
|
|
systemdTarget = "graphical-session.target";
|
|
|
|
events = [
|
|
{
|
|
event = "before-sleep";
|
|
command = "${pkgs.swaylock}/bin/swaylock -fF";
|
|
}
|
|
];
|
|
|
|
timeouts = [
|
|
{
|
|
timeout = 300;
|
|
command = "${pkgs.swaylock}/bin/swaylock -fF && ${pkgs.niri}/bin/niri msg action power-off-monitors";
|
|
}
|
|
{
|
|
timeout = 1800;
|
|
command = "${pkgs.systemd}/bin/systemctl suspend-then-hibernate";
|
|
}
|
|
];
|
|
};
|
|
}
|