flake/home/applications/swayidle/default.nix

31 lines
505 B
Nix

{
pkgs,
lib,
config,
...
}:
{
imports = [
../swaylock
];
services.swayidle = {
enable = true;
timeouts = [
{
timeout = 60 * 10;
command = "/run/current-system/sw/bin/systemctl suspend";
}
];
events = [
{
event = "lock";
command = lib.getExe config.programs.swaylock.package;
}
{
event = "before-sleep";
command = "/run/current-system/systemd/bin/loginctl lock-session";
}
];
};
}