Files
nixos-blueprint/hosts/sarien/work_user/desktop/river/swayidle.nix
unexplrd 2e6e28ef32 initial
2025-02-06 00:33:06 +02:00

34 lines
682 B
Nix

{
pkgs,
config,
lib,
...
}: {
options = {
swayidle.enable =
lib.mkEnableOption "enable swayidle";
};
config = lib.mkIf config.swayidle.enable {
services.swayidle = {
enable = true;
systemdTarget = "graphical-session.target";
timeouts = [
{
timeout = 300;
command = "${pkgs.swaylock-effects}/bin/swaylock -fF";
}
{
timeout = 600;
command = "${pkgs.niri}/bin/niri msg action power-off-monitors";
}
];
events = [
{
event = "before-sleep";
command = "${pkgs.swaylock-effects}/bin/swaylock -fF";
}
];
};
};
}