DeepSeek: Bluetooth on NixOS using LXQt desktop

I am running LXQt under NixOS and having problems getting Bluetooth to work. My computer is a old ThinkPad T61. The configuration.nix file currently uses pipewire instead of PulseAudio. Suggestions?

DeepSeek Response:

Getting Bluetooth to work on an older ThinkPad T61 running LXQt under NixOS with PipeWire instead of PulseAudio can be a bit tricky, but it’s definitely possible. Here’s a step-by-step guide to help you troubleshoot and configure Bluetooth properly:


1. Ensure Bluetooth Hardware is Recognized

First, verify that your Bluetooth hardware is detected by the system. Run the following command:

lsusb

Look for a Bluetooth adapter in the output. If it’s not listed, your hardware might not be supported or could be disabled in the BIOS.


2. Enable Bluetooth Services in configuration.nix

Ensure that the necessary Bluetooth services are enabled in your configuration.nix file. Add or update the following lines:

{
  hardware.bluetooth.enable = true; # Enable Bluetooth support
  services.blueman.enable = true;  # Optional: Blueman GUI for managing Bluetooth
  services.pipewire = {
    enable = true;
    alsa.enable = true;
    pulse.enable = true; # Enable PipeWire PulseAudio compatibility layer
  };
}

After making changes, rebuild your system:

sudo nixos-rebuild switch

3. Install Bluetooth Tools

Ensure you have the necessary Bluetooth utilities installed. Add the following to your environment.systemPackages in configuration.nix:

{
  environment.systemPackages = with pkgs; [
    bluez          # Bluetooth protocol stack
    bluez-tools    # Additional Bluetooth tools
    blueman        # Optional: GUI for managing Bluetooth
  ];
}

Rebuild your system again.


4. Start and Enable Bluetooth Service

Ensure the Bluetooth service is running:

sudo systemctl enable bluetooth.service
sudo systemctl start bluetooth.service

Check the status of the service:

sudo systemctl status bluetooth.service

If the service fails to start, check the logs for errors:

journalctl -u bluetooth.service

5. Configure PipeWire for Bluetooth Audio

PipeWire should handle Bluetooth audio out of the box, but ensure the following:

  • The pipewire-pulse service is running:
  systemctl --user status pipewire-pulse.service
  • If not, start it:
  systemctl --user start pipewire-pulse.service

6. Pair and Connect Devices

Use bluetoothctl or Blueman to pair and connect your Bluetooth devices.

Using bluetoothctl:

  1. Open a terminal and run:
   bluetoothctl
  1. Turn on Bluetooth:
   power on
  1. Enable agent:
   agent on
  1. Scan for devices:
   scan on
  1. Pair and connect to your device:
   pair <DEVICE_MAC>
   trust <DEVICE_MAC>
   connect <DEVICE_MAC>

Using Blueman:

  • Launch Blueman from your LXQt menu and follow the GUI to pair and connect your device.

7. Troubleshooting

  • No Sound Through Bluetooth: Ensure the correct audio profile is selected. Use pavucontrol (PulseAudio Volume Control) to check and switch the profile to A2DP for high-quality audio or HSP/HFP for headset functionality.
  • Bluetooth Device Not Found: Ensure your Bluetooth adapter is not blocked. Run:
  rfkill list

If it’s blocked, unblock it:

  rfkill unblock bluetooth
  • Permissions Issues: Ensure your user is in the lp group (required for Bluetooth):
  sudo usermod -aG lp $USER

8. Additional Resources

Leave a Comment

Licensed under CC BY-NC 4.0

DevOps viewpoints are those of its owner. You may share and adapt this article for non-commercial purposes, provided proper attribution is given. Attribution should include:

Title: DeepSeek: Bluetooth on NixOS using LXQt desktop
Author: peter arthur martin
Original URL: https://www.woodcentral.com/-/peter/deepseek-bluetooth-on-nixos-using-lxqt-desktop/
License: CC BY-NC 4.0

Site Index

👍 This page answered my questions

Your vote helps other woodworkers quickly find the answers and techniques that actually work in the shop.