fix(power): writes disabled on certain usb devices to avoid random wake-ups
This commit is contained in:
+19
-2
@@ -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;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user