nixos-configuration/homeConfigurations/muede/swayidle.nix
2026-04-17 12:59:54 +02:00

27 lines
580 B
Nix

{ pkgs, ... }:
{
services.swayidle =
let
lock-command = "${pkgs.systemd}/bin/loginctl lock-session";
in
{
enable = true;
systemdTarget = "graphical-session.target";
timeouts = [
{
timeout = 30;
command = lock-command;
}
{
timeout = 60 * 10;
command = "${pkgs.systemd}/bin/systemctl suspend";
}
];
events = [
{
event = "before-sleep";
command = "${pkgs.playerctl}/bin/playerctl pause; ${lock-command}";
}
];
};
}