Merge pull request #12683 from heydojo/bluetooth--plasma5
kde5 bluedevil plasmoid : enable bluez5 bluetooth functionality
This commit is contained in:
@@ -1,6 +1,43 @@
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with lib;
|
||||
let
|
||||
bluez-bluetooth = if config.services.xserver.desktopManager.kde4.enable then pkgs.bluez else pkgs.bluez5;
|
||||
|
||||
configBluez = {
|
||||
description = "Bluetooth Service";
|
||||
serviceConfig = {
|
||||
Type = "dbus";
|
||||
BusName = "org.bluez";
|
||||
ExecStart = "${bluez-bluetooth}/sbin/bluetoothd -n";
|
||||
};
|
||||
wantedBy = [ "bluetooth.target" ];
|
||||
};
|
||||
|
||||
configBluez5 = {
|
||||
description = "Bluetooth Service";
|
||||
serviceConfig = {
|
||||
Type = "dbus";
|
||||
BusName = "org.bluez";
|
||||
ExecStart = "${bluez-bluetooth}/sbin/bluetoothd -n";
|
||||
NotifyAccess="main";
|
||||
CapabilityBoundingSet="CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
|
||||
LimitNPROC=1;
|
||||
};
|
||||
wantedBy = [ "bluetooth.target" ];
|
||||
};
|
||||
|
||||
obexConfig = {
|
||||
description = "Bluetooth OBEX service";
|
||||
serviceConfig = {
|
||||
Type = "dbus";
|
||||
BusName = "org.bluez.obex";
|
||||
ExecStart = "${bluez-bluetooth}/sbin/obexd";
|
||||
};
|
||||
};
|
||||
|
||||
bluezConfig = if config.services.xserver.desktopManager.kde4.enable then configBluez else configBluez5;
|
||||
in
|
||||
|
||||
{
|
||||
|
||||
@@ -16,26 +53,15 @@ with lib;
|
||||
|
||||
};
|
||||
|
||||
|
||||
###### implementation
|
||||
|
||||
|
||||
config = mkIf config.hardware.bluetooth.enable {
|
||||
|
||||
environment.systemPackages = [ pkgs.bluez pkgs.openobex pkgs.obexftp ];
|
||||
|
||||
services.udev.packages = [ pkgs.bluez ];
|
||||
|
||||
services.dbus.packages = [ pkgs.bluez ];
|
||||
|
||||
systemd.services."dbus-org.bluez" = {
|
||||
description = "Bluetooth Service";
|
||||
serviceConfig = {
|
||||
Type = "dbus";
|
||||
BusName = "org.bluez";
|
||||
ExecStart = "${pkgs.bluez}/sbin/bluetoothd -n";
|
||||
};
|
||||
wantedBy = [ "bluetooth.target" ];
|
||||
};
|
||||
environment.systemPackages = [ bluez-bluetooth pkgs.openobex pkgs.obexftp ];
|
||||
services.udev.packages = [ bluez-bluetooth ];
|
||||
services.dbus.packages = [ bluez-bluetooth ];
|
||||
systemd.services."dbus-org.bluez" = bluezConfig;
|
||||
systemd.services."dbus-org.bluez.obex" = obexConfig;
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user