Skip to content

Instantly share code, notes, and snippets.

@spaceCamel
Last active March 20, 2020 17:20
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spaceCamel/f40d2d551b4a990f6464 to your computer and use it in GitHub Desktop.
Save spaceCamel/f40d2d551b4a990f6464 to your computer and use it in GitHub Desktop.
PulseAudio + Bluetooth Headset
nixpkgs.config = {
packageOverrides = pkgs: {
bluez = pkgs.bluez5;
};
};
hardware.pulseaudio.enable = true;
hardware.pulseaudio.package = pkgs.pulseaudioFull;
hardware.bluetooth.enable = true;

After updating the configuration

nixos-rebuild switch

I had to restart the system for pulseaudio to load the bluetooth module.

pactl list should show the bluetooth module.

As I'm not using a desktop-manager I've configured the device from the command line following ArchLinux instructions

$ bluetoothctl
[bluetooth] # power on
[bluetooth] # agent on
[bluetooth] # default-agent
[bluetooth] # scan on
...put device in pairing mode and wait [hex-address] to appear here...
[bluetooth] # pair [hex-address]
[bluetooth] # connect [hex-address]

I've then played some audio and opened configured PulseAudio using pavucontrol. I changed the headset profile to "High Fidelity Playback (A2DP Sink)" to have decent audio quality.

@jb55
Copy link

jb55 commented Dec 7, 2015

Thanks, this worked! Only extra step I had to do was remove the device first and re-pair.

@MasseGuillaume
Copy link

thanks man!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment