@@ -31,9 +31,6 @@ let
3131
3232 cp ${pkgs.dbus.out}/share/dbus-1/{system,session}.conf $out
3333
34− # avoid circular includes
35− sed -ri 's@(<include ignore_missing="yes">/etc/dbus-1/(system|session)\.conf</include>)@<!-- \1 -->@g' $out/{system,session}.conf
36−
3734 # include by full path
3835 sed -ri "s@/etc/dbus-1/(system|session)-@$out/\1-@" $out/{system,session}.conf
3936
@@ -98,11 +95,6 @@ in
9895
9996 environment.systemPackages = [ pkgs.dbus.daemon pkgs.dbus ];
10097
101− environment.etc = singleton
102− { source = configDir;
103− target = "dbus-1";
104− };
105−
10698 users.extraUsers.messagebus = {
10799 uid = config.ids.uids.messagebus;
108100 description = "D-Bus system message bus daemon user";
@@ -134,8 +126,8 @@ in
134126 reloadIfChanged = true;
135127 restartTriggers = [ configDir ];
136128 serviceConfig.ExecStart = [
137− ""
138− "${lib.getBin pkgs.dbus}/bin/dbus-daemon --config-file=${configDir}/system.conf ${daemonArgs}"
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}"
139131 ];
140132 };
141133
@@ -145,13 +137,17 @@ in
145137 reloadIfChanged = true;
146138 restartTriggers = [ configDir ];
147139 serviceConfig.ExecStart = [
148− ""
149− "${lib.getBin pkgs.dbus}/bin/dbus-daemon --config-file=${configDir}/session.conf ${daemonArgs}"
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}"
150142 ];
151143 };
152144 sockets.dbus.wantedBy = mkIf cfg.socketActivated [ "sockets.target" ];
153145 };
154146
155147 environment.pathsToLink = [ "/etc/dbus-1" "/share/dbus-1" ];
148+
149+ system.extraSystemBuilderCmds = ''
150+ ln -s ${configDir} $out/dbus
151+ '';
156152 };
157153}