By: Ammar <ammar.nanjiani@gmail.com>
fix(steammachine): apply Valve's BlueZ fix for the Switch Pro Controller The Nintendo Switch Pro Controller (057e:2009) drops its Bluetooth link on the Steam Machine. Valve fixes this on SteamOS with a downstream BlueZ patch that is not upstream and never will be: it was proposed as bluez/bluez#2480 and closed unmerged, so no BlueZ release carries it and no upgrade can deliver it. The patch adds BT_IO_OPT_FORCE_ACTIVE and, for this one controller's interrupt channel, sets BT_POWER_FORCE_ACTIVE_OFF. It stops forcing the link out of sniff mode on every outgoing packet, which is what Valve's own upstream proposal names as the cause of the disconnects. Valve writes it against 5.83 but all 15 hunks apply to the 5.87 source that nixpkgs pins, with zero fuzz. It is fetched and extracted from Valve's source archive rather than vendored so the provenance stays visible; btio compiles into bluetoothd and not into libbluetooth, so it is daemon-side only and changes no ABI. hardware.bluetooth.package is pinned to the overlaid derivation so a later override of that option cannot silently drop the patch. Not verified against hardware yet: this is a plausible mechanism applied cleanly, not a tested fix.