Skip to content
Permalink
Browse files

kdeconnect: activate via dbus/systemd

  • Loading branch information
peterhoeg committed Aug 22, 2019
1 parent 1412af4 commit 9814fb28cfe09a67997cf3f316b039c3b631b06d
Showing with 36 additions and 23 deletions.
  1. +36 −23 pkgs/applications/misc/kdeconnect/default.nix
@@ -1,24 +1,28 @@
{ mkDerivation
, lib
, fetchurl
, extra-cmake-modules
, kcmutils
, kconfigwidgets
, kdbusaddons
, kdoctools
, kiconthemes
, ki18n
, knotifications
, qca-qt5
, libfakekey
, libXtst
, qtx11extras
, sshfs
, makeWrapper
, kwayland
{ mkDerivation, lib, fetchurl, extra-cmake-modules, makeWrapper, writeText
, kcmutils, kconfigwidgets, kdbusaddons, kdoctools, kiconthemes
, ki18n, knotifications, kwayland
, qtbase, qtx11extras, qca-qt5
, libfakekey, libXtst, sshfs
}:

mkDerivation rec {
let
busName = "org.kde.kdeconnect";

service = writeText "kdeconnectd.service" ''
[Unit]
Description = KDE Connect
[Service]
Environment = "QML2_IMPORT_PATH=${qtbase.bin}/${qtbase.qtQmlPrefix}"
Environment = "QT_PLUGIN_PATH=${qtbase.bin}/${qtbase.qtPluginPrefix}"
Type = dbus
BusName = ${busName}
ExecStart = @out@/libexec/kdeconnectd
Restart = on-failure
Slice = kde.slice
'';

in mkDerivation rec {
pname = "kdeconnect";
version = "1.3.5";

@@ -29,14 +33,23 @@ mkDerivation rec {

buildInputs = [
libfakekey libXtst
ki18n kiconthemes kcmutils kconfigwidgets kdbusaddons knotifications
qca-qt5 qtx11extras makeWrapper kwayland
ki18n kiconthemes kcmutils kconfigwidgets kdbusaddons knotifications kwayland
qca-qt5 qtx11extras
];

nativeBuildInputs = [ extra-cmake-modules kdoctools ];
nativeBuildInputs = [ extra-cmake-modules kdoctools makeWrapper ];

postInstall = ''
wrapProgram $out/libexec/kdeconnectd --prefix PATH : ${lib.makeBinPath [ sshfs ]}
wrapProgram $out/libexec/kdeconnectd \
--prefix PATH : ${lib.makeBinPath [ sshfs ]}
echo "SystemdService=dbus-${busName}.service" >> $out/share/dbus-1/services/${busName}.service
mkdir -p $out/lib/systemd/user
substitute ${service} $out/lib/systemd/user/kdeconnectd.service \
--subst-var out
ln -s $out/lib/systemd/user/kdeconnectd.service $out/lib/systemd/user/dbus-${busName}.service
sed -i $out/etc/xdg/autostart/${busName}.daemon.desktop \
-e 's@^Exec.*@Exec=systemctl --user start kdeconnectd.service@'
'';

enableParallelBuilding = true;

0 comments on commit 9814fb2

Please sign in to comment.
You can’t perform that action at this time.