bluez service: use upstream units
This commit is contained in:
parent
496476be4e
commit
4abcef2ba1
|
@ -2,41 +2,9 @@
|
|||
|
||||
with lib;
|
||||
let
|
||||
bluez-bluetooth = if config.services.xserver.desktopManager.kde4.enable then pkgs.bluez else pkgs.bluez5;
|
||||
isBluez4 = config.services.xserver.desktopManager.kde4.enable;
|
||||
bluez-bluetooth = if isBluez4 then pkgs.bluez4 else pkgs.bluez;
|
||||
|
||||
configBluez = {
|
||||
description = "Bluetooth Service";
|
||||
serviceConfig = {
|
||||
Type = "dbus";
|
||||
BusName = "org.bluez";
|
||||
ExecStart = "${getBin bluez-bluetooth}/bin/bluetoothd -n";
|
||||
};
|
||||
wantedBy = [ "bluetooth.target" ];
|
||||
};
|
||||
|
||||
configBluez5 = {
|
||||
description = "Bluetooth Service";
|
||||
serviceConfig = {
|
||||
Type = "dbus";
|
||||
BusName = "org.bluez";
|
||||
ExecStart = "${getBin bluez-bluetooth}/bin/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 = "${getBin bluez-bluetooth}/bin/obexd";
|
||||
};
|
||||
};
|
||||
|
||||
bluezConfig = if config.services.xserver.desktopManager.kde4.enable then configBluez else configBluez5;
|
||||
in
|
||||
|
||||
{
|
||||
|
@ -58,10 +26,21 @@ in
|
|||
config = mkIf config.hardware.bluetooth.enable {
|
||||
|
||||
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;
|
||||
|
||||
systemd.packages = [ bluez-bluetooth ];
|
||||
|
||||
systemd.services.bluetooth = {
|
||||
wantedBy = [ "bluetooth.target" ];
|
||||
aliases = [ "dbus-org.bluez.service" ];
|
||||
};
|
||||
|
||||
systemd.user.services.obex = mkIf (!isBluez4) {
|
||||
aliases = [ "dbus-org.bluez.obex.service" ];
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue