mirror of
https://github.com/nmasur/dotfiles
synced 2024-12-25 19:24:53 +00:00
e8f4ee52c3
also pin nil version maybe it fixed sleep issues as well?
29 lines
778 B
Nix
29 lines
778 B
Nix
{ config, lib, ... }: {
|
|
|
|
config = lib.mkIf config.physical {
|
|
|
|
# Prevent wake from keyboard
|
|
powerManagement.powerDownCommands = ''
|
|
set +e
|
|
|
|
for power in /sys/bus/i2c/devices/i2c-*/device/power; do echo disabled > ''${power}/wakeup || true; done
|
|
for power in /sys/bus/usb/devices/1-*/power; do echo disabled > ''${power}/wakeup || true; done
|
|
|
|
# Fix for Gigabyte motherboard
|
|
# /r/archlinux/comments/y7b97e/my_computer_wakes_up_immediately_after_i_suspend/isu99sr/
|
|
echo GPP0 > /proc/acpi/wakeup
|
|
|
|
sleep 2
|
|
|
|
set -e
|
|
'';
|
|
|
|
services.udev.extraRules = ''
|
|
ACTION=="add", SUBSYSTEM=="usb", DRIVER=="usb", ATTR{power/wakeup}="disabled"
|
|
ACTION=="add", SUBSYSTEM=="i2c", ATTR{power/wakeup}="disabled"
|
|
'';
|
|
|
|
};
|
|
|
|
}
|