From 252b3d5dace14028a089a6971c7e15d9f0d0aabb Mon Sep 17 00:00:00 2001 From: Noah Masur <7386960+nmasur@users.noreply.github.com> Date: Wed, 22 Feb 2023 23:46:24 -0500 Subject: [PATCH] temp: broken sleep attempt --- modules/nixos/hardware/sleep.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/modules/nixos/hardware/sleep.nix b/modules/nixos/hardware/sleep.nix index 1a1aa5f..f5db8a6 100644 --- a/modules/nixos/hardware/sleep.nix +++ b/modules/nixos/hardware/sleep.nix @@ -4,9 +4,17 @@ # Prevent wake from keyboard powerManagement.powerDownCommands = '' - for wakeup in /sys/bus/usb/devices/1-*/power/wakeup; do echo disabled > $wakeup; done + # for power in /sys/bus/usb/devices/*/power; do echo disabled > ''${power}/wakeup; done + + # AMD issue: https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Instantaneous_wakeups_from_suspend + for power in /sys/bus/i2c/devices/i2c-*/device/power; do echo disabled > ''${power}/wakeup; done ''; + # From here: https://www.reddit.com/r/NixOS/comments/wcu34f/how_would_i_do_this_in_nix/ + # services.udev.extraRules = '' + # ACTION=="add", SUBSYSTEM=="i2c", ATTRS{idVendor}=="", ATTRS{idProduct}=="" RUN+="${pkgs.bash}/bin/bash -c 'echo disabled > /sys/bus/i2c/devices/i2c-*/power/wakeup'" + # ''; + }; }