Bluetooth: Add systemd service to enable adapter at boot
This commit is contained in:
parent
578314605f
commit
7614f02d79
|
@ -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";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue