nixos-config/modules/home/wms/programs/swayidle/default.nix

35 lines
787 B
Nix

{ config, lib, pkgs, ... }:
{
config = lib.mkIf config.home.desktop.enable {
services.swayidle = {
enable = config.home.desktop.enable;
timeouts = [
{
timeout = 1800;
command = "notify-send 'Locking in 30 seconds'";
}
{
timeout = 1830;
command = "swaylock";
}
{
timeout = 3600;
command = "swaymsg 'output * dpms off'";
resumeCommand = "swaymsg 'output * dpms on'";
}
{
timeout = 3605;
command = "systemctl suspend";
}
];
events = [
{
event = "before-sleep";
command = "swaylock";
}
];
};
home.packages = with pkgs; [ sway-audio-idle-inhibit ];
};
}