Converted swayidle to a home module

This commit is contained in:
alejandro-angulo 2024-08-03 08:15:19 -07:00
parent 9fb7bb1ae1
commit 0862244fd2
Signed by: alejandro-angulo
GPG key ID: 75579581C74554B6
4 changed files with 43 additions and 44 deletions

View file

@ -1,41 +0,0 @@
{
options,
config,
lib,
pkgs,
...
}:
with lib; let
cfg = config.aa.desktop.addons.swayidle;
in {
options.aa.desktop.addons.swayidle = with types; {
enable = mkEnableOption "swayidle";
};
config = mkIf cfg.enable {
environment.systemPackages = with pkgs; [swayidle];
aa.home.extraOptions = {
services.swayidle = {
enable = true;
timeouts = [
{
timeout = 300;
command = "${pkgs.swaylock}/bin/swaylock";
}
{
timeout = 600;
command = "${pkgs.sway}/bin/swaymsg 'output * dpms off'";
resumeCommand = "${pkgs.sway}/bin/swaymsg 'output * dpms on'";
}
];
events = [
{
event = "before-sleep";
command = "${pkgs.swaylock}/bin/swaylock";
}
];
};
};
};
}

View file

@ -38,7 +38,6 @@ in {
aa.desktop.addons = {
alacritty.enable = true;
gammastep.enable = true;
swayidle.enable = true;
# TODO
# light