diff options
author | William A. Kennington III <william@wkennington.com> | 2016-03-06 17:38:53 -0800 |
---|---|---|
committer | Thomas Tuegel <ttuegel@gmail.com> | 2016-05-02 13:04:20 -0500 |
commit | 60b34849284db4aec8f4fdab722273096e1ed002 (patch) | |
tree | f458386757900944ca33e90f9c4e3e5290dd70b5 /nixos | |
parent | f04e0e70e8ddb82686a2f660d292e7338ed564d2 (diff) | |
download | nixlib-60b34849284db4aec8f4fdab722273096e1ed002.tar nixlib-60b34849284db4aec8f4fdab722273096e1ed002.tar.gz nixlib-60b34849284db4aec8f4fdab722273096e1ed002.tar.bz2 nixlib-60b34849284db4aec8f4fdab722273096e1ed002.tar.lz nixlib-60b34849284db4aec8f4fdab722273096e1ed002.tar.xz nixlib-60b34849284db4aec8f4fdab722273096e1ed002.tar.zst nixlib-60b34849284db4aec8f4fdab722273096e1ed002.zip |
dbus: Fix for new 1.10 version
(cherry picked from commit 68a4a6df3971d66aa988bba680351a30fbadbed3)
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/services/system/dbus.nix | 68 | ||||
-rw-r--r-- | nixos/modules/system/boot/systemd.nix | 2 |
2 files changed, 26 insertions, 44 deletions
diff --git a/nixos/modules/services/system/dbus.nix b/nixos/modules/services/system/dbus.nix index 59c2e482e1ad..434211aaac41 100644 --- a/nixos/modules/services/system/dbus.nix +++ b/nixos/modules/services/system/dbus.nix @@ -10,6 +10,16 @@ let homeDir = "/var/run/dbus"; + systemExtraxml = concatStrings (flip concatMap cfg.packages (d: [ + "<servicedir>${d}/share/dbus-1/system-services</servicedir>" + "<includedir>${d}/etc/dbus-1/system.d</includedir>" + ])); + + sessionExtraxml = concatStrings (flip concatMap cfg.packages (d: [ + "<servicedir>${d}/share/dbus-1/services</servicedir>" + "<includedir>${d}/etc/dbus-1/session.d</includedir>" + ])); + configDir = pkgs.stdenv.mkDerivation { name = "dbus-conf"; @@ -19,47 +29,17 @@ let buildCommand = '' mkdir -p $out - cp -v ${pkgs.dbus.daemon}/etc/dbus-1/system.conf $out/system.conf - - # !!! Hm, these `sed' calls are rather error-prone... - - # Tell the daemon where the setuid wrapper around - # dbus-daemon-launch-helper lives. - sed -i $out/system.conf \ - -e 's|<servicehelper>.*/libexec/dbus-daemon-launch-helper|<servicehelper>${config.security.wrapperDir}/dbus-daemon-launch-helper|' - - # Add the system-services and system.d directories to the system - # bus search path. - sed -i $out/system.conf \ - -e 's|<standard_system_servicedirs/>|${systemServiceDirs}|' \ - -e 's|<includedir>system.d</includedir>|${systemIncludeDirs}|' + sed '${./dbus-system-local.conf.in}' \ + -e 's,@servicehelper@,${config.security.wrapperDir}/dbus-daemon-launch-helper,g' \ + -e 's,@extra@,${systemExtraxml},' \ + > "$out/system-local.conf" - cp ${pkgs.dbus.daemon}/etc/dbus-1/session.conf $out/session.conf - - # Add the services and session.d directories to the session bus - # search path. - sed -i $out/session.conf \ - -e 's|<standard_session_servicedirs />|${sessionServiceDirs}&|' \ - -e 's|<includedir>session.d</includedir>|${sessionIncludeDirs}|' - ''; # */ + sed '${./dbus-session-local.conf.in}' \ + -e 's,@extra@,${sessionExtraxml},' \ + > "$out/session-local.conf" + ''; }; - systemServiceDirs = concatMapStrings - (d: "<servicedir>${d}/share/dbus-1/system-services</servicedir> ") - cfg.packages; - - systemIncludeDirs = concatMapStrings - (d: "<includedir>${d}/etc/dbus-1/system.d</includedir> ") - cfg.packages; - - sessionServiceDirs = concatMapStrings - (d: "<servicedir>${d}/share/dbus-1/services</servicedir> ") - cfg.packages; - - sessionIncludeDirs = concatMapStrings - (d: "<includedir>${d}/etc/dbus-1/session.d</includedir> ") - cfg.packages; - in { @@ -72,7 +52,7 @@ in enable = mkOption { type = types.bool; - default = true; + default = false; internal = true; description = '' Whether to start the D-Bus message bus daemon, which is @@ -82,7 +62,7 @@ in packages = mkOption { type = types.listOf types.path; - default = []; + default = [ ]; description = '' Packages whose D-Bus configuration files should be included in the configuration of the D-Bus system-wide message bus. @@ -129,10 +109,10 @@ in permissions = "u+rx,g+rx,o-rx"; }; - services.dbus.packages = - [ "/nix/var/nix/profiles/default" - config.system.path - ]; + services.dbus.packages = [ + pkgs.dbus + config.system.path + ]; # Don't restart dbus-daemon. Bad things tend to happen if we do. systemd.services.dbus.reloadIfChanged = true; diff --git a/nixos/modules/system/boot/systemd.nix b/nixos/modules/system/boot/systemd.nix index 3f497566ff11..e7f892945315 100644 --- a/nixos/modules/system/boot/systemd.nix +++ b/nixos/modules/system/boot/systemd.nix @@ -689,6 +689,8 @@ in "systemd/system-generators" = { source = generators; }; }); + services.dbus.enable = true; + system.activationScripts.systemd = stringAfter [ "groups" ] '' mkdir -m 0755 -p /var/lib/udev |