Skip to content
Permalink
Browse files

kdeconnect: let dbus activate via systemd

  • Loading branch information
peterhoeg committed Mar 14, 2017
1 parent 2839b10 commit 011392dca5e802c44c9306ffa54428102aa4a368
Showing with 35 additions and 2 deletions.
  1. +35 −2 pkgs/applications/misc/kdeconnect/default.nix
@@ -12,9 +12,35 @@
, qca-qt5
, libfakekey
, libXtst
, writeText
}:

stdenv.mkDerivation rec {
let
busName = "org.kde.kdeconnect";
serviceName = "kdeconnectd.service";

dbus = writeText "dbus-${serviceName}" ''
[D-BUS Service]
Name=${busName}
Exec=@out@/lib/libexec/kdeconnectd
SystemdService=dbus-${busName}.service
'';

service = writeText serviceName ''
[Unit]
Description=KDE Connect daemon
[Service]
Type=dbus
BusName=${busName}
ExecStart=@out@/lib/libexec/kdeconnectd
ExecStop=${kdbusaddons}/bin/kquitapp5 kdeconnectd
Restart=on-failure
PrivateTmp=true
Slice=kde.slice
'';

in stdenv.mkDerivation rec {
name = "kdeconnect-${version}";
version = "1.0.3";

@@ -42,6 +68,14 @@ stdenv.mkDerivation rec {

postInstall = ''
wrapQtProgram "$out/bin/kdeconnect-cli"
mkdir -p $out/lib/systemd/user $out/share/dbus-1/services
sed "s|@out@|$out|g" ${service} > $out/lib/systemd/user/${serviceName}
ln -sr $out/lib/systemd/user/${serviceName} $out/lib/systemd/user/dbus-${busName}.service
rm -f $out/etc/xdg/autostart/${serviceName}
sed "s|@out@|$out|g" ${dbus} > $out/share/dbus-1/services/${busName}.service
'';

meta = {
@@ -50,5 +84,4 @@ stdenv.mkDerivation rec {
maintainers = with lib.maintainers; [ fridh ];
homepage = https://community.kde.org/KDEConnect;
};

}

0 comments on commit 011392d

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