diff --git a/modules/nixos/hardware/sleep.nix b/modules/nixos/hardware/sleep.nix index 96d2dd8..205f737 100644 --- a/modules/nixos/hardware/sleep.nix +++ b/modules/nixos/hardware/sleep.nix @@ -7,7 +7,7 @@ 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-*/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/ @@ -16,6 +16,11 @@ set -e ''; + services.udev.extraRules = '' + ACTION=="add", SUBSYSTEM=="usb", DRIVER=="usb", ATTR{power/wakeup}="disabled" + ACTION=="add", SUBSYSTEM=="i2c", ATTR{power/wakeup}="disabled" + ''; + }; }