dbus service: use makeDBusConf

This commit is contained in:
Nikolay Amiantov 2017-02-16 14:56:45 +03:00
parent 3e23ec4450
commit ac0cdc1952
3 changed files with 4 additions and 37 deletions

View File

@ -1,5 +0,0 @@
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
@extra@
</busconfig>

View File

@ -1,6 +0,0 @@
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
<busconfig>
<servicehelper>@servicehelper@</servicehelper>
@extra@
</busconfig>

View File

@ -10,32 +10,10 @@ let
homeDir = "/run/dbus";
systemExtraxml = concatStrings (flip concatMap cfg.packages (d: [
"<servicedir>${d}/share/dbus-1/system-services</servicedir>"
"<includedir>${d}/etc/dbus-1/system.d</includedir>"
]));
sessionExtraxml = concatStrings (flip concatMap cfg.packages (d: [
"<servicedir>${d}/share/dbus-1/services</servicedir>"
"<includedir>${d}/etc/dbus-1/session.d</includedir>"
]));
configDir = pkgs.runCommand "dbus-conf"
{ preferLocalBuild = true;
allowSubstitutes = false;
}
''
mkdir -p $out
sed '${./dbus-system-local.conf.in}' \
-e 's,@servicehelper@,${config.security.wrapperDir}/dbus-daemon-launch-helper,g' \
-e 's,@extra@,${systemExtraxml},' \
> "$out/system-local.conf"
sed '${./dbus-session-local.conf.in}' \
-e 's,@extra@,${sessionExtraxml},' \
> "$out/session-local.conf"
'';
configDir = pkgs.makeDBusConf {
suidHelper = "${config.security.wrapperDir}/dbus-daemon-launch-helper";
serviceDirectories = cfg.packages;
};
in