@@ -20,8 +20,6 @@ let
2020 "<includedir>${d}/etc/dbus-1/session.d</includedir>"
2121 ]));
2222
23− daemonArgs = "--address=systemd: --nofork --nopidfile --systemd-activation";
24−
2523 configDir = pkgs.runCommand "dbus-conf"
2624 { preferLocalBuild = true;
2725 allowSubstitutes = false;
@@ -29,11 +27,6 @@ let
2927 ''
3028 mkdir -p $out
3129
32− cp ${pkgs.dbus.out}/share/dbus-1/{system,session}.conf $out
33−
34− # include by full path
35− sed -ri "s@/etc/dbus-1/(system|session)-@$out/\1-@" $out/{system,session}.conf
36−
3730 sed '${./dbus-system-local.conf.in}' \
3831 -e 's,@servicehelper@,${config.security.wrapperDir}/dbus-daemon-launch-helper,g' \
3932 -e 's,@extra@,${systemExtraxml},' \
@@ -95,6 +88,11 @@ in
9588
9689 environment.systemPackages = [ pkgs.dbus.daemon pkgs.dbus ];
9790
91+ environment.etc = singleton
92+ { source = configDir;
93+ target = "dbus-1";
94+ };
95+
9896 users.extraUsers.messagebus = {
9997 uid = config.ids.uids.messagebus;
10098 description = "D-Bus system message bus daemon user";
@@ -125,10 +123,6 @@ in
125123 # Don't restart dbus-daemon. Bad things tend to happen if we do.
126124 reloadIfChanged = true;
127125 restartTriggers = [ configDir ];
128− serviceConfig.ExecStart = [
129− "" # Default dbus.service has two entries, we need to override both.
130− "${lib.getBin pkgs.dbus}/bin/dbus-daemon --config-file=/run/current-system/dbus/system.conf ${daemonArgs}"
131− ];
132126 };
133127
134128 systemd.user = {
@@ -136,18 +130,10 @@ in
136130 # Don't restart dbus-daemon. Bad things tend to happen if we do.
137131 reloadIfChanged = true;
138132 restartTriggers = [ configDir ];
139− serviceConfig.ExecStart = [
140− "" # Default dbus.service has two entries, we need to override both.
141− "${lib.getBin pkgs.dbus}/bin/dbus-daemon --config-file=/run/current-system/dbus/session.conf ${daemonArgs}"
142− ];
143133 };
144134 sockets.dbus.wantedBy = mkIf cfg.socketActivated [ "sockets.target" ];
145135 };
146136
147137 environment.pathsToLink = [ "/etc/dbus-1" "/share/dbus-1" ];
148−
149− system.extraSystemBuilderCmds = ''
150− ln -s ${configDir} $out/dbus
151− '';
152138 };
153139}