Nixpkgs: Add custom bluetooth configuration (bluez)

Created on 13 Nov 2016  路  5Comments  路  Source: NixOS/nixpkgs

Issue description

Is there a way to specify additional configuration options for bluetooth?

In other distributions that would be done via /etc/bluetooth/main.conf but it seems like this file is not used by bluetoothd in NixOS.

Some analysis:

  • man bluetoothd also says that the global configuration file lies under /nix/store/1y10j7yy40c6wgywavbn3xa2wwim2pnp-bluez-5.40/etc/bluetooth/main.conf.

I want to add the following to the configuration for bluetooth:

[General]
ControllerMode = bredr
question community feedback

Most helpful comment

This issue can be closed now, as the feature has been merged.

All 5 comments

I think you would need to extend the bluetooth service to support passing additional config options.
https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/hardware/bluetooth.nix

If you come here only for pairing your bluetooth headset: I only needed the options to pair a pair of Bose QuietComfort 35, afterwards it seems like the options are not needed anymore.

So if somebody comes here from google, checkout nixpkgs locally, add the file manually in the build of bluez, build via nixos-rebuild switch -I /path/to/nixpkgs. Then pair your headphone and afterwards you can switch back to your normal system config.


It seems like bluetoothd has no easy way to specify a config file via commandline other than baking it it into the build of bluez which is not really a good thing.

What is a good workaround to make it possible to configure a package that requires the info during build time? I don't want to compile bluez and all that depend on it each time I change the config.

Perhaps @ierton has an idea?

Could we maybe use a link to link to a user-specified config file from the main config file? I have the exact same problem and current workaround is indeed pretty burdensome.

I would have hoped that somebody could point me to an existing solution, because I would guess that this is not an unusual scenario.

@mkawalec Good idea, but if you generate the user-specified config file then you have to include the file in the main-config file from the build which changes the build and leads to re-builds, or is there something I don't see?

This issue can be closed now, as the feature has been merged.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sid-kap picture sid-kap  路  3Comments

yawnt picture yawnt  路  3Comments

ghost picture ghost  路  3Comments

ayyess picture ayyess  路  3Comments

chris-martin picture chris-martin  路  3Comments