Upgraded snowfall lib
This commit is contained in:
parent
7e87dbc55b
commit
a1709f033f
58 changed files with 22 additions and 19 deletions
41
modules/nixos/desktop/addons/swayidle/default.nix
Normal file
41
modules/nixos/desktop/addons/swayidle/default.nix
Normal file
|
@ -0,0 +1,41 @@
|
|||
{
|
||||
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";
|
||||
}
|
||||
];
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue