I have an intel wifi/bluetooth card in my laptop. One of the antennas got ripped off causing the bluetooth to not work, but the wifi still works.
How do I disable the bluetooth of the card from being detected?
I would like to use a bluetooth dongle instead, which isn’t being detected, but I guess that calls for another topic…
Yes, basically. You just have to figure out which rule you actually need in your case, depending on the IDs for your device. Which you might get from looking at the output of lspci or lsusb depending on what kind of device you have.
For instance on my desktop system with a bluetooth USB dongle, I can do
lsusb | grep Bluetooth
to get this:
Bus 003 Device 004: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Now this being a USB device, it will be found under /dev/usb/. And since it is device 004 on bus 003, it is this file /dev/usb/003/004.
You can then use udevadm to get some info on the device:
udevadm info -q all -a /dev/bus/usb/003/004
The output basically tells you what you can do with it in udev rules. In particular my device has the attirbute ATTR{authorized}=="1" and is located on SUBSYSTEM=="usb". If you set authorized to 0 I’d assume the device will go away.
So for my USB dongle you might try the follow rule:
You can mark it as a solution if it actually worked and then post the section of your configuration.nix that you used. Then others can come and copy-paste it if they need something similar.
If it doesn’t work we shall see what the issue is.
# Disable the laptop's intel bluetooth
services.udev.extraRules = {
SUBSYSTEM="usb"; ATTR{idVendor}="8087"; ATTR{idProduct}="0a2a"; ATTR{authorized}="0";
};
I tried the double == before and was getting syntax errors and now the compiler is saying that it expected a . or = in place of the second ATTR’s first {.
Could you give an example of what the syntax should look like?
Thanks