2022-06-26 10:26:21 +00:00
|
|
|
{ runCommand
|
|
|
|
, writeText
|
|
|
|
, libxslt
|
|
|
|
, dbus
|
|
|
|
, findXMLCatalogs
|
2020-04-24 23:36:52 +00:00
|
|
|
, serviceDirectories ? []
|
|
|
|
, suidHelper ? "/var/setuid-wrappers/dbus-daemon-launch-helper"
|
2020-11-21 19:51:51 +00:00
|
|
|
, apparmor ? "disabled" # one of enabled, disabled, required
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
/* DBus has two configuration parsers -- normal and "trivial", which is used
|
|
|
|
* for suid helper. Unfortunately the latter doesn't support <include>
|
|
|
|
* directive. That means that we can't just place our configuration to
|
|
|
|
* *-local.conf -- it needs to be in the main configuration file.
|
|
|
|
*/
|
|
|
|
runCommand "dbus-1"
|
|
|
|
{
|
2020-11-21 19:51:51 +00:00
|
|
|
inherit serviceDirectories suidHelper apparmor;
|
2020-04-24 23:36:52 +00:00
|
|
|
preferLocalBuild = true;
|
|
|
|
allowSubstitutes = false;
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
libxslt.bin
|
|
|
|
findXMLCatalogs
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
dbus.out
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|
|
|
|
''
|
|
|
|
mkdir -p $out
|
|
|
|
|
|
|
|
xsltproc --nonet \
|
|
|
|
--stringparam serviceDirectories "$serviceDirectories" \
|
|
|
|
--stringparam suidHelper "$suidHelper" \
|
2020-11-21 19:51:51 +00:00
|
|
|
--stringparam apparmor "$apparmor" \
|
2020-04-24 23:36:52 +00:00
|
|
|
${./make-system-conf.xsl} ${dbus}/share/dbus-1/system.conf \
|
|
|
|
> $out/system.conf
|
|
|
|
xsltproc --nonet \
|
|
|
|
--stringparam serviceDirectories "$serviceDirectories" \
|
2020-11-21 19:51:51 +00:00
|
|
|
--stringparam apparmor "$apparmor" \
|
2020-04-24 23:36:52 +00:00
|
|
|
${./make-session-conf.xsl} ${dbus}/share/dbus-1/session.conf \
|
|
|
|
> $out/session.conf
|
|
|
|
''
|