Merge pull request #12683 from heydojo/bluetooth--plasma5

kde5 bluedevil plasmoid : enable bluez5 bluetooth functionality

Changed files
+110 -17
nixos
modules
services
hardware
pkgs
+43 -17
nixos/modules/services/hardware/bluetooth.nix
···
{ config, lib, pkgs, ... }:
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" ];
-
};
};
···
{ 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
{
···
};
###### implementation
+
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;
};
+2
pkgs/desktops/plasma-5.5/bluedevil.nix
···
postInstall = ''
wrapQtProgram "$out/bin/bluedevil-wizard"
wrapQtProgram "$out/bin/bluedevil-sendfile"
'';
}
···
postInstall = ''
wrapQtProgram "$out/bin/bluedevil-wizard"
wrapQtProgram "$out/bin/bluedevil-sendfile"
+
# Fix the location of logic.js for the plasmoid
+
ln -s $out/share/plasma/plasmoids/org.kde.plasma.bluetooth/contents/code/logic.js $out/share/plasma/plasmoids/org.kde.plasma.bluetooth/contents/ui/logic.js
'';
}
+61
pkgs/os-specific/linux/bluez/bluez-5.37-obexd_without_systemd-1.patch
···
···
+
Submitted By: Armin K. <krejzi at email dot com>
+
Date: 2013-04-29
+
Initial Package Version: 5.17
+
Upstream Status: unknown
+
Origin: Arch Linux (Giovanni Campagna)
+
Description: Allow using obexd without systemd in the user session
+
+
Not all sessions run systemd --user (actually, the majority
+
doesn't), so the dbus daemon must be able to spawn obexd
+
directly, and to do so it needs the full path of the daemon.
+
---
+
Makefile.obexd | 4 ++--
+
obexd/src/org.bluez.obex.service | 4 ----
+
obexd/src/org.bluez.obex.service.in | 4 ++++
+
3 files changed, 6 insertions(+), 6 deletions(-)
+
delete mode 100644 obexd/src/org.bluez.obex.service
+
create mode 100644 obexd/src/org.bluez.obex.service.in
+
+
diff --git a/Makefile.obexd b/Makefile.obexd
+
index 3760867..142e7c3 100644
+
--- a/Makefile.obexd
+
+++ b/Makefile.obexd
+
@@ -2,12 +2,12 @@
+
if SYSTEMD
+
systemduserunitdir = @SYSTEMD_USERUNITDIR@
+
systemduserunit_DATA = obexd/src/obex.service
+
+endif
+
+
dbussessionbusdir = @DBUS_SESSIONBUSDIR@
+
dbussessionbus_DATA = obexd/src/org.bluez.obex.service
+
-endif
+
+
-EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service
+
+EXTRA_DIST += obexd/src/obex.service.in obexd/src/org.bluez.obex.service.in
+
+
obex_plugindir = $(libdir)/obex/plugins
+
+
diff --git a/obexd/src/org.bluez.obex.service b/obexd/src/org.bluez.obex.service
+
deleted file mode 100644
+
index a538088..0000000
+
--- a/obexd/src/org.bluez.obex.service
+
+++ /dev/null
+
@@ -1,4 +0,0 @@
+
-[D-BUS Service]
+
-Name=org.bluez.obex
+
-Exec=/bin/false
+
-SystemdService=dbus-org.bluez.obex.service
+
diff --git a/obexd/src/org.bluez.obex.service.in b/obexd/src/org.bluez.obex.service.in
+
new file mode 100644
+
index 0000000..9c815f2
+
--- /dev/null
+
+++ b/obexd/src/org.bluez.obex.service.in
+
@@ -0,0 +1,4 @@
+
+[D-BUS Service]
+
+Name=org.bluez.obex
+
+Exec=@libexecdir@/obexd
+
+SystemdService=dbus-org.bluez.obex.service
+
--
+
1.8.3.1
+
+
+3
pkgs/os-specific/linux/bluez/bluez5.nix
···
# gstreamer gst_plugins_base
];
preConfigure = ''
substituteInPlace tools/hid2hci.rules --replace /sbin/udevadm ${systemd}/bin/udevadm
substituteInPlace tools/hid2hci.rules --replace "hid2hci " "$out/lib/udev/hid2hci "
···
# for bluez4 compatibility for NixOS
mkdir $out/sbin
ln -s ../libexec/bluetooth/bluetoothd $out/sbin/bluetoothd
'';
meta = with stdenv.lib; {
···
# gstreamer gst_plugins_base
];
+
patches = [ ./bluez-5.37-obexd_without_systemd-1.patch ];
+
preConfigure = ''
substituteInPlace tools/hid2hci.rules --replace /sbin/udevadm ${systemd}/bin/udevadm
substituteInPlace tools/hid2hci.rules --replace "hid2hci " "$out/lib/udev/hid2hci "
···
# for bluez4 compatibility for NixOS
mkdir $out/sbin
ln -s ../libexec/bluetooth/bluetoothd $out/sbin/bluetoothd
+
ln -s ../libexec/bluetooth/obexd $out/sbin/obexd
'';
meta = with stdenv.lib; {
+1
pkgs/os-specific/linux/bluez/bluez5_28.nix
···
# for bluez4 compatibility for NixOS
mkdir $out/sbin
ln -s ../libexec/bluetooth/bluetoothd $out/sbin/bluetoothd
'';
meta = with stdenv.lib; {
···
# for bluez4 compatibility for NixOS
mkdir $out/sbin
ln -s ../libexec/bluetooth/bluetoothd $out/sbin/bluetoothd
+
ln -s ../libexec/bluetooth/obexd $out/sbin/obexd
'';
meta = with stdenv.lib; {