dbus: Fix for new 1.10 version

(cherry picked from commit 68a4a6df3971d66aa988bba680351a30fbadbed3)

authored by

William A. Kennington III and committed by
Thomas Tuegel
60b34849 f04e0e70

+26 -44
+24 -44
nixos/modules/services/system/dbus.nix
··· 10 10 11 11 homeDir = "/var/run/dbus"; 12 12 13 + systemExtraxml = concatStrings (flip concatMap cfg.packages (d: [ 14 + "<servicedir>${d}/share/dbus-1/system-services</servicedir>" 15 + "<includedir>${d}/etc/dbus-1/system.d</includedir>" 16 + ])); 17 + 18 + sessionExtraxml = concatStrings (flip concatMap cfg.packages (d: [ 19 + "<servicedir>${d}/share/dbus-1/services</servicedir>" 20 + "<includedir>${d}/etc/dbus-1/session.d</includedir>" 21 + ])); 22 + 13 23 configDir = pkgs.stdenv.mkDerivation { 14 24 name = "dbus-conf"; 15 25 ··· 19 29 buildCommand = '' 20 30 mkdir -p $out 21 31 22 - cp -v ${pkgs.dbus.daemon}/etc/dbus-1/system.conf $out/system.conf 23 - 24 - # !!! Hm, these `sed' calls are rather error-prone... 25 - 26 - # Tell the daemon where the setuid wrapper around 27 - # dbus-daemon-launch-helper lives. 28 - sed -i $out/system.conf \ 29 - -e 's|<servicehelper>.*/libexec/dbus-daemon-launch-helper|<servicehelper>${config.security.wrapperDir}/dbus-daemon-launch-helper|' 32 + sed '${./dbus-system-local.conf.in}' \ 33 + -e 's,@servicehelper@,${config.security.wrapperDir}/dbus-daemon-launch-helper,g' \ 34 + -e 's,@extra@,${systemExtraxml},' \ 35 + > "$out/system-local.conf" 30 36 31 - # Add the system-services and system.d directories to the system 32 - # bus search path. 33 - sed -i $out/system.conf \ 34 - -e 's|<standard_system_servicedirs/>|${systemServiceDirs}|' \ 35 - -e 's|<includedir>system.d</includedir>|${systemIncludeDirs}|' 36 - 37 - cp ${pkgs.dbus.daemon}/etc/dbus-1/session.conf $out/session.conf 38 - 39 - # Add the services and session.d directories to the session bus 40 - # search path. 41 - sed -i $out/session.conf \ 42 - -e 's|<standard_session_servicedirs />|${sessionServiceDirs}&|' \ 43 - -e 's|<includedir>session.d</includedir>|${sessionIncludeDirs}|' 44 - ''; # */ 37 + sed '${./dbus-session-local.conf.in}' \ 38 + -e 's,@extra@,${sessionExtraxml},' \ 39 + > "$out/session-local.conf" 40 + ''; 45 41 }; 46 42 47 - systemServiceDirs = concatMapStrings 48 - (d: "<servicedir>${d}/share/dbus-1/system-services</servicedir> ") 49 - cfg.packages; 50 - 51 - systemIncludeDirs = concatMapStrings 52 - (d: "<includedir>${d}/etc/dbus-1/system.d</includedir> ") 53 - cfg.packages; 54 - 55 - sessionServiceDirs = concatMapStrings 56 - (d: "<servicedir>${d}/share/dbus-1/services</servicedir> ") 57 - cfg.packages; 58 - 59 - sessionIncludeDirs = concatMapStrings 60 - (d: "<includedir>${d}/etc/dbus-1/session.d</includedir> ") 61 - cfg.packages; 62 - 63 43 in 64 44 65 45 { ··· 72 52 73 53 enable = mkOption { 74 54 type = types.bool; 75 - default = true; 55 + default = false; 76 56 internal = true; 77 57 description = '' 78 58 Whether to start the D-Bus message bus daemon, which is ··· 82 62 83 63 packages = mkOption { 84 64 type = types.listOf types.path; 85 - default = []; 65 + default = [ ]; 86 66 description = '' 87 67 Packages whose D-Bus configuration files should be included in 88 68 the configuration of the D-Bus system-wide message bus. ··· 129 109 permissions = "u+rx,g+rx,o-rx"; 130 110 }; 131 111 132 - services.dbus.packages = 133 - [ "/nix/var/nix/profiles/default" 134 - config.system.path 135 - ]; 112 + services.dbus.packages = [ 113 + pkgs.dbus 114 + config.system.path 115 + ]; 136 116 137 117 # Don't restart dbus-daemon. Bad things tend to happen if we do. 138 118 systemd.services.dbus.reloadIfChanged = true;
+2
nixos/modules/system/boot/systemd.nix
··· 689 689 "systemd/system-generators" = { source = generators; }; 690 690 }); 691 691 692 + services.dbus.enable = true; 693 + 692 694 system.activationScripts.systemd = stringAfter [ "groups" ] 693 695 '' 694 696 mkdir -m 0755 -p /var/lib/udev