Bluetooth not working in sway (did in gnome)

Hi there.

I have been configuring Bluetooth on my workstations with the [following code](nixos/modules/hw/bluetooth/default.nix at main · bashfulrobot/nixos.

I have this working in Gnome, but for some reason, when I switch to Sway (2 systems), it does not work. The code is imported in the same spot, with the same files, without change. All I changed was enabling the other desktop (separate file).

It is enabled here: nixos/archetype/tower/default.nix at main · bashfulrobot/nixos and here: nixos/archetype/laptop/default.nix at main · bashfulrobot/nixos

What is happening is what when I open blueman it displays:

Connection to BlueZ Failed

Bluez daemon is not running, blueman-manager cannot continue.

I also tried launching blueberry and had noticed:

Could not retrieve the BT adapter name with 'bt-adapter -i': Command '['timeout', '2s', '/nix/store/1csh3vvn1k8yylrhphz805nq833d879g-bluez-tools-0-unstable-2020-10-24/bin/bt-adapter', '-i']' died with <Signals.SIGABRT: 6>.
**
ERROR:lib/helpers.c:320:intf_supported: assertion failed: (introspection_proxy != NULL)
timeout: the monitored command dumped core

which is essentially from when Blueberry runs: /nix/store/1csh3vvn1k8yylrhphz805nq833d879g-bluez-tools-0-unstable-2020-10-24/bin/bt-adapter -i.

Also ran:

❯ sudo systemctl status bluetooth.target 
● bluetooth.target - Bluetooth Support
     Loaded: loaded (/etc/systemd/system/bluetooth.target; linked; preset: enabled)
     Active: active since Wed 2024-07-03 09:59:31 PDT; 4h 39min ago
       Docs: man:systemd.special(7)

Also tried;

❯ blueman-manager --loglevel DEBUG

(.blueman-manager-wrapped:197378): Gtk-WARNING **: 14:40:53.770: Theme parsing error: gtk.css:2:123: Failed to import: Error opening file /home/dustin/.local/share/gnome-shell/extensions/unite@hardpixel.eu/styles/gtk3/buttons-right/maximized.css: No such file or directory
blueman-manager 14.40.53 INFO     PluginManager:86 load_plugin: ['Notes', 'Services', 'Info', 'PulseAudioProfile']
blueman-manager 14.40.53 INFO     PluginManager:159 __load_plugin: loading <class 'blueman.plugins.manager.Notes.Notes'>
blueman-manager 14.40.53 INFO     PluginManager:159 __load_plugin: loading <class 'blueman.plugins.manager.Services.Services'>
blueman-manager 14.40.53 INFO     PluginManager:159 __load_plugin: loading <class 'blueman.plugins.manager.Info.Info'>
blueman-manager 14.40.53 INFO     PluginManager:159 __load_plugin: loading <class 'blueman.plugins.manager.PulseAudioProfile.PulseAudioProfile'>
blueman-manager 14.40.53 INFO     PulseAudioUtils:207 pa_context_event: 1
blueman-manager 14.40.53 INFO     PulseAudioUtils:207 pa_context_event: 2
blueman-manager 14.40.53 INFO     PulseAudioUtils:207 pa_context_event: 3
blueman-manager 14.40.53 INFO     Manager:98 on_dbus_name_vanished: org.bluez
blueman-manager 14.40.53 INFO     PulseAudioUtils:207 pa_context_event: 4
blueman-manager 14.40.53 INFO     PulseAudioProfile:32 on_pa_ready: connected
blueman-manager 14.40.53 INFO     PulseAudioUtils:213 <lambda>  : 1
blueman-manager 14.40.56 INFO     PulseAudioUtils:380 _on_delete: Destroying PulseAudioUtils instance
blueman-manager 14.40.56 INFO     PulseAudioUtils:207 pa_context_event: 6
blueman-manager 14.40.56 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.manager.PulseAudioProfile.PulseAudioProfile object at 0x7f4ef2d35990>
blueman-manager 14.40.56 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.manager.Info.Info object at 0x7f4ef03a3590>
blueman-manager 14.40.56 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.manager.Services.Services object at 0x7f4ef0549090>
blueman-manager 14.40.56 DEBUG    BasePlugin:63 _on_plugin_delete: Deleting plugin instance <blueman.plugins.manager.Notes.Notes object at 0x7f4ef39ad250>

Journalctl turns up:

Jul 03 09:45:22 rembot bluetoothd[1466963]: Bluetooth management interface 1.22 initialized
Jul 03 09:45:22 rembot bluetoothd[1466963]: Battery Provider Manager created
Jul 03 09:45:22 rembot bluetoothd[1466963]: Failed to set mode: Failed (0x03)
Jul 03 09:45:22 rembot bluetoothd[1466963]: src/gatt-database.c:database_add_chrc() Failed to create characteristic entry in database
Jul 03 09:45:22 rembot bluetoothd[1466963]: src/gatt-database.c:database_add_service() Failed to add characteristic
Jul 03 09:45:22 rembot bluetoothd[1466963]: src/gatt-database.c:database_add_app() Failed to add service
Jul 03 09:45:22 rembot bluetoothd[1466963]: src/gatt-database.c:client_ready_cb() Failed to create GATT service entry in local database
Jul 03 09:45:22 rembot bluetoothd[1466963]: Endpoint registered: sender=:1.107 path=/MediaEndpoint/A2DPSource/ldac

<snip/>

Jul 03 09:55:29 rembot bluetoothd[1466963]: Endpoint unregistered: sender=:1.107 path=/MediaEndpoint/A2DPSource/opus_05_duplex
Jul 03 09:58:36 rembot bluetoothd[1466963]: Disconnected from D-Bus. Exiting.
Jul 03 09:58:36 rembot bluetoothd[1466963]: Battery Provider Manager destroyed
Jul 03 09:58:36 rembot bluetoothd[1466963]: Stopping SDP server
Jul 03 09:58:36 rembot bluetoothd[1466963]: Exit
Jul 03 09:58:36 rembot systemd[1]: bluetooth.service: Got notification message from PID 1466963, but reception is disabled.
Jul 03 09:58:36 rembot systemd[1]: bluetooth.service: Deactivated successfully.```

That’s using // to join mkIfs again, just like in WHy would the location of network.networkmanager make a difference? - #3 by jtojnar.

You should hate me. :man_facepalming::rofl: time to search all.