about summary refs log tree commit diff
path: root/nixos
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2017-02-01 23:00:07 +0300
committerGitHub <noreply@github.com>2017-02-01 23:00:07 +0300
commitc34cfa21d4f195c0b3e8ee6d466127ffa2884a51 (patch)
tree69e3c0b491bf482a8d327374684210dc7767545f /nixos
parent2bf0fd0f294e0c1e52e36b9c2aba257f5fe4d468 (diff)
parent72b37462668e3a7568d94632994a9df5d7fd37eb (diff)
downloadnixlib-c34cfa21d4f195c0b3e8ee6d466127ffa2884a51.tar
nixlib-c34cfa21d4f195c0b3e8ee6d466127ffa2884a51.tar.gz
nixlib-c34cfa21d4f195c0b3e8ee6d466127ffa2884a51.tar.bz2
nixlib-c34cfa21d4f195c0b3e8ee6d466127ffa2884a51.tar.lz
nixlib-c34cfa21d4f195c0b3e8ee6d466127ffa2884a51.tar.xz
nixlib-c34cfa21d4f195c0b3e8ee6d466127ffa2884a51.tar.zst
nixlib-c34cfa21d4f195c0b3e8ee6d466127ffa2884a51.zip
Merge pull request #22343 from abbradar/dbus-etc
dbus service: use /etc/dbus-1 for configuration
Diffstat (limited to 'nixos')
-rw-r--r--nixos/modules/services/system/dbus.nix24
1 files changed, 5 insertions, 19 deletions
diff --git a/nixos/modules/services/system/dbus.nix b/nixos/modules/services/system/dbus.nix
index bc91d1284a9f..aeb5bf9c7a36 100644
--- a/nixos/modules/services/system/dbus.nix
+++ b/nixos/modules/services/system/dbus.nix
@@ -20,8 +20,6 @@ let
     "<includedir>${d}/etc/dbus-1/session.d</includedir>"
   ]));
 
-  daemonArgs = "--address=systemd: --nofork --nopidfile --systemd-activation";
-
   configDir = pkgs.runCommand "dbus-conf"
     { preferLocalBuild = true;
       allowSubstitutes = false;
@@ -29,11 +27,6 @@ let
     ''
       mkdir -p $out
 
-      cp ${pkgs.dbus.out}/share/dbus-1/{system,session}.conf $out
-
-      # include by full path
-      sed -ri "s@/etc/dbus-1/(system|session)-@$out/\1-@" $out/{system,session}.conf
-
       sed '${./dbus-system-local.conf.in}' \
         -e 's,@servicehelper@,${config.security.wrapperDir}/dbus-daemon-launch-helper,g' \
         -e 's,@extra@,${systemExtraxml},' \
@@ -95,6 +88,11 @@ in
 
     environment.systemPackages = [ pkgs.dbus.daemon pkgs.dbus ];
 
+    environment.etc = singleton
+      { source = configDir;
+        target = "dbus-1";
+      };
+
     users.extraUsers.messagebus = {
       uid = config.ids.uids.messagebus;
       description = "D-Bus system message bus daemon user";
@@ -125,10 +123,6 @@ in
       # Don't restart dbus-daemon. Bad things tend to happen if we do.
       reloadIfChanged = true;
       restartTriggers = [ configDir ];
-      serviceConfig.ExecStart = [
-        "" # Default dbus.service has two entries, we need to override both.
-        "${lib.getBin pkgs.dbus}/bin/dbus-daemon --config-file=/run/current-system/dbus/system.conf ${daemonArgs}"
-      ];
     };
 
     systemd.user = {
@@ -136,18 +130,10 @@ in
         # Don't restart dbus-daemon. Bad things tend to happen if we do.
         reloadIfChanged = true;
         restartTriggers = [ configDir ];
-        serviceConfig.ExecStart = [
-          "" # Default dbus.service has two entries, we need to override both.
-          "${lib.getBin pkgs.dbus}/bin/dbus-daemon --config-file=/run/current-system/dbus/session.conf ${daemonArgs}"
-        ];
       };
       sockets.dbus.wantedBy = mkIf cfg.socketActivated [ "sockets.target" ];
     };
 
     environment.pathsToLink = [ "/etc/dbus-1" "/share/dbus-1" ];
-
-    system.extraSystemBuilderCmds = ''
-      ln -s ${configDir} $out/dbus
-    '';
   };
 }