feat(desktop): add 'swayidle' module

This commit is contained in:
2026-08-22 21:51:46 +02:00
parent 699db10eeb
commit 53505743c8
3 changed files with 34 additions and 5 deletions
+31
View File
@@ -0,0 +1,31 @@
{
config,
lib,
pkgs,
...
}:
let
cfg = config.swayidle;
in
{
options.swayidle = {
enable = lib.mkEnableOption "swayidle";
timeout = lib.mkOption {
type = lib.types.ints.positive;
default = 900;
};
};
config = lib.mkIf cfg.enable {
services.swayidle = {
enable = true;
timeouts = [
{
inherit (cfg) timeout;
command = "${lib.getExe' pkgs.systemd "systemctl"} suspend";
}
];
};
};
}