From 25fd35862a71a78a00597b0b720f29b8a260422e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 26 Jul 2010 14:10:04 +0000 Subject: [PATCH] * Add /nix/var/nix/profiles/default and config.system.path to the list of DBus configuration directories. Thus packages with DBus configuration files installed in the default profile will be found automatically. (It would be nice to include $HOME/.nix-profile in the session bus search path, but I don't think that's possible.) svn path=/nixos/trunk/; revision=22737 --- modules/services/system/dbus.nix | 35 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 18 deletions(-) diff --git a/modules/services/system/dbus.nix b/modules/services/system/dbus.nix index d6e647ac2dd..fedb5efff06 100644 --- a/modules/services/system/dbus.nix +++ b/modules/services/system/dbus.nix @@ -29,26 +29,16 @@ let # Add the system-services and system.d directories to the system # bus search path. sed -i $out/system.conf \ - -e 's||${systemServiceDirs}|' + -e 's||${systemServiceDirs}|' \ + -e 's|system.d|${systemIncludeDirs}|' cp ${dbus}/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||${sessionServiceDirs}|' - - ensureDir $out/session.d - ensureDir $out/system.d - - for i in ${toString cfg.packages}; do - for j in $i/etc/dbus-1/session.d/*; do - ln -s $j $out/session.d/ - done - for j in $i/etc/dbus-1/system.d/*; do - ln -s $j $out/system.d/ - done - done + -e 's||${sessionServiceDirs}|' \ + -e 's|session.d|${sessionIncludeDirs}|' ''; # */ }; @@ -56,10 +46,18 @@ let (d: "${d}/share/dbus-1/system-services ") cfg.packages; + systemIncludeDirs = concatMapStrings + (d: "${d}/etc/dbus-1/system.d ") + cfg.packages; + sessionServiceDirs = concatMapStrings (d: "${d}/share/dbus-1/services ") cfg.packages; + sessionIncludeDirs = concatMapStrings + (d: "${d}/etc/dbus-1/session.d ") + cfg.packages; + in { @@ -102,10 +100,6 @@ in environment.systemPackages = [ dbus.daemon dbus.tools ]; environment.etc = singleton - # We need /etc/dbus-1/system.conf for now, because - # dbus-daemon-launch-helper is called with an empty environment - # and no arguments. So we have no way to tell it the location - # of our config file. { source = configDir; target = "dbus-1"; }; @@ -162,6 +156,11 @@ in permissions = "u+rx,g+rx,o-rx"; }; + services.dbus.packages = + [ "/nix/var/nix/profiles/default" + config.system.path + ]; + }; }