1
0
Fork 0

Bluetooth: Add systemd service to enable adapter at boot

This commit is contained in:
Aires 2024-07-17 11:08:22 -04:00
parent 578314605f
commit 7614f02d79

View file

@ -33,5 +33,19 @@ in
# Add Bluetooth LE audio support # Add Bluetooth LE audio support
environment.systemPackages = with pkgs; [ liblc3 ]; environment.systemPackages = with pkgs; [ liblc3 ];
# FIXME: Create systemd service to manually start the adapter on boot.
# This is a workaround for hardware.bluetooth.powerOnBoot not working as expected.
systemd.services.startBluetooth = {
description = "Manually starts the Bluetooth service on boot";
after = [ "bluetooth.target" ];
wantedBy = [ "multi-user.target" ];
serviceConfig = {
type = "simple";
ExecStart = "${pkgs.bluez}/bin/bluetoothctl -- power on";
Restart = "always";
RestartSec = "5s";
};
};
}; };
} }