fix(power): writes disabled on certain usb devices to avoid random wake-ups

This commit is contained in:
kenji
2026-01-11 19:02:18 -06:00
parent 7281eedf56
commit 2ef1d58ea7
+19 -2
View File
@@ -1,4 +1,21 @@
{pkgs, ...}: {
# USB wakeup configuration - Temporarily Disabled
# systemd.services.disable-usb-wakeups = { ... };
# USB wakeup configuration
# Disabling USB wakeups to prevent accidental wakeups from mouse/keyboard/bluetooth
systemd.services.disable-usb-wakeups = {
description = "Disable USB wakeup triggers";
wantedBy = ["multi-user.target" "post-resume.target"];
after = ["post-resume.target"];
serviceConfig = {
Type = "oneshot";
ExecStart = pkgs.writeShellScript "disable-usb-wakeups" ''
for device in XHC0 XHC1 XHC2 XH00 GPP0 GPP7; do
if grep -q "$device.*enabled" /proc/acpi/wakeup; then
echo "Disabling wakeup for $device"
echo "$device" > /proc/acpi/wakeup
fi
done
'';
RemainAfterExit = true;
};
};
}