File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change 2626 description = "Name of the bluetooth user" ;
2727 } ;
2828
29+ defaultName = mkOption {
30+ type = types . str ;
31+ default = "Ghaf" ;
32+ description = ''
33+ Default Bluetooth adapter name.
34+
35+ If unset, BlueZ will attempt to fetch the hostname via hostnamed DBus service.
36+ If hostnamed is disabled, BlueZ will fall back to "BlueZ [BlueZ version]".
37+ '' ;
38+ } ;
39+
2940 } ;
3041 config = mkIf cfg . enable {
3142
3243 # Enable bluetooth
3344 hardware . bluetooth = {
3445 enable = true ;
46+ # Save battery by disabling bluetooth on boot
47+ powerOnBoot = false ;
48+ # https://github.com/bluez/bluez/blob/master/src/main.conf full list of options
49+ settings = {
50+ General = {
51+ Name = lib . optionalAttrs ( cfg . defaultName != null && cfg . defaultName != "" ) cfg . defaultName ;
52+ FastConnectable = "true" ;
53+ JustWorksRepairing = "confirm" ;
54+ Privacy = "device" ;
55+ DiscoverableTimeout = "60" ; # Default is 180 seconds
56+ } ;
57+ } ;
3558 } ;
3659
3760 # Setup bluetooth user and group
You can’t perform that action at this time.
0 commit comments