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 11 homeDir = "/var/run/dbus"; 12 13 configDir = pkgs.stdenv.mkDerivation { 14 name = "dbus-conf"; 15 ··· 19 buildCommand = '' 20 mkdir -p $out 21 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|' 30 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 - ''; # */ 45 }; 46 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 in 64 65 { ··· 72 73 enable = mkOption { 74 type = types.bool; 75 - default = true; 76 internal = true; 77 description = '' 78 Whether to start the D-Bus message bus daemon, which is ··· 82 83 packages = mkOption { 84 type = types.listOf types.path; 85 - default = []; 86 description = '' 87 Packages whose D-Bus configuration files should be included in 88 the configuration of the D-Bus system-wide message bus. ··· 129 permissions = "u+rx,g+rx,o-rx"; 130 }; 131 132 - services.dbus.packages = 133 - [ "/nix/var/nix/profiles/default" 134 - config.system.path 135 - ]; 136 137 # Don't restart dbus-daemon. Bad things tend to happen if we do. 138 systemd.services.dbus.reloadIfChanged = true;
··· 10 11 homeDir = "/var/run/dbus"; 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 + 23 configDir = pkgs.stdenv.mkDerivation { 24 name = "dbus-conf"; 25 ··· 29 buildCommand = '' 30 mkdir -p $out 31 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" 36 37 + sed '${./dbus-session-local.conf.in}' \ 38 + -e 's,@extra@,${sessionExtraxml},' \ 39 + > "$out/session-local.conf" 40 + ''; 41 }; 42 43 in 44 45 { ··· 52 53 enable = mkOption { 54 type = types.bool; 55 + default = false; 56 internal = true; 57 description = '' 58 Whether to start the D-Bus message bus daemon, which is ··· 62 63 packages = mkOption { 64 type = types.listOf types.path; 65 + default = [ ]; 66 description = '' 67 Packages whose D-Bus configuration files should be included in 68 the configuration of the D-Bus system-wide message bus. ··· 109 permissions = "u+rx,g+rx,o-rx"; 110 }; 111 112 + services.dbus.packages = [ 113 + pkgs.dbus 114 + config.system.path 115 + ]; 116 117 # Don't restart dbus-daemon. Bad things tend to happen if we do. 118 systemd.services.dbus.reloadIfChanged = true;
+2
nixos/modules/system/boot/systemd.nix
··· 689 "systemd/system-generators" = { source = generators; }; 690 }); 691 692 system.activationScripts.systemd = stringAfter [ "groups" ] 693 '' 694 mkdir -m 0755 -p /var/lib/udev
··· 689 "systemd/system-generators" = { source = generators; }; 690 }); 691 692 + services.dbus.enable = true; 693 + 694 system.activationScripts.systemd = stringAfter [ "groups" ] 695 '' 696 mkdir -m 0755 -p /var/lib/udev