Bluetooth: Difference between revisions

imported>Grahamc
Add troubleshooting info for a disabled bluetooth controller
imported>Makefu
No edit summary
Line 11: Line 11:


==Pairing Bluetooth devices==
==Pairing Bluetooth devices==
{{expansion}}


In order to use Bluetooth devices, they must be paired with your NixOS machine. Heavier desktop environments will usually provide a Bluetooth management GUI which you can use to pair devices.
In order to use Bluetooth devices, they must be paired with your NixOS machine. Heavier desktop environments will usually provide a Bluetooth management GUI which you can use to pair devices.
Line 53: Line 52:
You can verify that PulseAudio has loaded the Bluetooth module by running <tt>pactl list | grep -i 'Name.*module.*blue'</tt>; Bluetooth modules should be present in the list.
You can verify that PulseAudio has loaded the Bluetooth module by running <tt>pactl list | grep -i 'Name.*module.*blue'</tt>; Bluetooth modules should be present in the list.


===System-Wide PulseAudio ===
When you are running <code>pulseAudio</code> system-wide then you will need to add the following modules to your <code>default.pa</code> configuration:
<syntaxHighlight lang="nix">
hardware.pulseAudio.configFile = pkgs.writeText "default.pa" ''
  load-module module-bluetooth-policy
  load-module module-bluetooth-discover
  load-module module-bluez5-device
  load-module module-bluez5-discover
'';
</syntaxHighlight>
===Enabling A2DP Sink===
===Enabling A2DP Sink===
Modern headsets will generally try to connect using the A2DP profile. To enable this for your bluetooth connection, add the following to <tt>/etc/nixos/configuration.nix</tt>
Modern headsets will generally try to connect using the A2DP profile. To enable this for your bluetooth connection, add the following to <tt>/etc/nixos/configuration.nix</tt>
Line 104: Line 113:
$ sudo rfkill unblock bluetooth
$ sudo rfkill unblock bluetooth
</syntaxhighlight>
</syntaxhighlight>