summary refs log tree commit diff
path: root/nixos/modules/services
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services')
-rw-r--r--nixos/modules/services/hardware/bluetooth.nix6
-rw-r--r--nixos/modules/services/misc/octoprint.nix2
-rw-r--r--nixos/modules/services/networking/networkmanager.nix8
-rw-r--r--nixos/modules/services/system/dbus-session-local.conf.in5
-rw-r--r--nixos/modules/services/system/dbus-system-local.conf.in6
-rw-r--r--nixos/modules/services/system/dbus.nix68
-rw-r--r--nixos/modules/services/web-servers/apache-httpd/trac.nix2
-rw-r--r--nixos/modules/services/x11/desktop-managers/enlightenment.nix2
-rw-r--r--nixos/modules/services/x11/desktop-managers/kde4.nix6
-rw-r--r--nixos/modules/services/x11/desktop-managers/kde5.nix80
10 files changed, 73 insertions, 112 deletions
diff --git a/nixos/modules/services/hardware/bluetooth.nix b/nixos/modules/services/hardware/bluetooth.nix
index fc95c4910bf7..2c271b328179 100644
--- a/nixos/modules/services/hardware/bluetooth.nix
+++ b/nixos/modules/services/hardware/bluetooth.nix
@@ -9,7 +9,7 @@ let
         serviceConfig = {
           Type = "dbus";
           BusName = "org.bluez";
-          ExecStart = "${bluez-bluetooth}/sbin/bluetoothd -n";
+          ExecStart = "${getBin bluez-bluetooth}/bin/bluetoothd -n";
         };
         wantedBy = [ "bluetooth.target" ];
     };
@@ -19,7 +19,7 @@ let
         serviceConfig = {
           Type = "dbus";
           BusName = "org.bluez";
-          ExecStart = "${bluez-bluetooth}/sbin/bluetoothd -n";
+          ExecStart = "${getBin bluez-bluetooth}/bin/bluetoothd -n";
           NotifyAccess="main";
           CapabilityBoundingSet="CAP_NET_ADMIN CAP_NET_BIND_SERVICE";
           LimitNPROC=1;
@@ -32,7 +32,7 @@ let
         serviceConfig = {
           Type = "dbus";
           BusName = "org.bluez.obex";
-          ExecStart = "${bluez-bluetooth}/sbin/obexd";
+          ExecStart = "${getBin bluez-bluetooth}/bin/obexd";
         };
     };
 
diff --git a/nixos/modules/services/misc/octoprint.nix b/nixos/modules/services/misc/octoprint.nix
index 8d46bca99f99..c2b3f63be7d4 100644
--- a/nixos/modules/services/misc/octoprint.nix
+++ b/nixos/modules/services/misc/octoprint.nix
@@ -102,7 +102,7 @@ in
       wantedBy = [ "multi-user.target" ];
       after = [ "network.target" ];
       path = [ pluginsEnv ];
-      environment.PYTHONPATH = makeSearchPathOutputs pkgs.python.sitePackages ["lib"] [ pluginsEnv ];
+      environment.PYTHONPATH = makeSearchPathOutput "lib" pkgs.python.sitePackages [ pluginsEnv ];
 
       preStart = ''
         mkdir -p "${cfg.stateDir}"
diff --git a/nixos/modules/services/networking/networkmanager.nix b/nixos/modules/services/networking/networkmanager.nix
index 9912ad9ae3fc..e9eea6a2cae1 100644
--- a/nixos/modules/services/networking/networkmanager.nix
+++ b/nixos/modules/services/networking/networkmanager.nix
@@ -114,10 +114,12 @@ in {
       # Ugly hack for using the correct gnome3 packageSet
       basePackages = mkOption {
         type = types.attrsOf types.package;
-        default = { inherit networkmanager modemmanager wpa_supplicant
+        default = { inherit modemmanager wpa_supplicant
                             networkmanager_openvpn networkmanager_vpnc
                             networkmanager_openconnect
-                            networkmanager_pptp networkmanager_l2tp; };
+                            networkmanager_pptp networkmanager_l2tp;
+                    networkmanager = networkmanager.out;
+                  };
         internal = true;
       };
 
@@ -187,7 +189,7 @@ in {
 
     boot.kernelModules = [ "ppp_mppe" ]; # Needed for most (all?) PPTP VPN connections.
 
-    environment.etc = with cfg.basePackages; [
+    environment.etc = with mapAttrs (name: getBin) cfg.basePackages; [
       { source = ipUpScript;
         target = "NetworkManager/dispatcher.d/01nixos-ip-up";
       }
diff --git a/nixos/modules/services/system/dbus-session-local.conf.in b/nixos/modules/services/system/dbus-session-local.conf.in
new file mode 100644
index 000000000000..5fd6f80a3539
--- /dev/null
+++ b/nixos/modules/services/system/dbus-session-local.conf.in
@@ -0,0 +1,5 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+  @extra@
+</busconfig>
diff --git a/nixos/modules/services/system/dbus-system-local.conf.in b/nixos/modules/services/system/dbus-system-local.conf.in
new file mode 100644
index 000000000000..edbb476f585a
--- /dev/null
+++ b/nixos/modules/services/system/dbus-system-local.conf.in
@@ -0,0 +1,6 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+  <servicehelper>@servicehelper@</servicehelper>
+  @extra@
+</busconfig>
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/services/web-servers/apache-httpd/trac.nix b/nixos/modules/services/web-servers/apache-httpd/trac.nix
index c4aa6b6ad3a3..3196edc2838b 100644
--- a/nixos/modules/services/web-servers/apache-httpd/trac.nix
+++ b/nixos/modules/services/web-servers/apache-httpd/trac.nix
@@ -96,7 +96,7 @@ in
   globalEnvVars = singleton
     { name = "PYTHONPATH";
       value =
-        makeSearchPathOutputs "lib/${pkgs.python.libPrefix}/site-packages" ["lib"]
+        makeSearchPathOutput "lib" "lib/${pkgs.python.libPrefix}/site-packages"
           [ pkgs.mod_python
             pkgs.pythonPackages.trac
             pkgs.setuptools
diff --git a/nixos/modules/services/x11/desktop-managers/enlightenment.nix b/nixos/modules/services/x11/desktop-managers/enlightenment.nix
index 11df7297833b..2e788d869607 100644
--- a/nixos/modules/services/x11/desktop-managers/enlightenment.nix
+++ b/nixos/modules/services/x11/desktop-managers/enlightenment.nix
@@ -7,7 +7,7 @@ let
   e = pkgs.enlightenment;
   xcfg = config.services.xserver;
   cfg = xcfg.desktopManager.enlightenment;
-  GST_PLUGIN_PATH = lib.makeSearchPathOutputs "lib/gstreamer-1.0" ["lib"] [
+  GST_PLUGIN_PATH = lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" [
     pkgs.gst_all_1.gst-plugins-base
     pkgs.gst_all_1.gst-plugins-good
     pkgs.gst_all_1.gst-plugins-bad
diff --git a/nixos/modules/services/x11/desktop-managers/kde4.nix b/nixos/modules/services/x11/desktop-managers/kde4.nix
index 80e408be4923..1927341e45d4 100644
--- a/nixos/modules/services/x11/desktop-managers/kde4.nix
+++ b/nixos/modules/services/x11/desktop-managers/kde4.nix
@@ -29,7 +29,7 @@ let
 
   phononBackends = {
     gstreamer = [
-      pkgs.phonon_backend_gstreamer
+      pkgs.phonon-backend-gstreamer
       pkgs.gst_all.gstPluginsBase
       pkgs.gst_all.gstPluginsGood
       pkgs.gst_all.gstPluginsUgly
@@ -38,7 +38,7 @@ let
       pkgs.gst_all.gstreamer # needed?
     ];
 
-    vlc = [pkgs.phonon_backend_vlc];
+    vlc = [pkgs.phonon-backend-vlc];
   };
 
   phononBackendPackages = flip concatMap cfg.phononBackends
@@ -111,7 +111,7 @@ in
             # Load PulseAudio module for routing support.
             # See http://colin.guthr.ie/2009/10/so-how-does-the-kde-pulseaudio-support-work-anyway/
             ${optionalString config.hardware.pulseaudio.enable ''
-              ${config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1"
+              ${getBin config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1"
             ''}
 
             # Start KDE.
diff --git a/nixos/modules/services/x11/desktop-managers/kde5.nix b/nixos/modules/services/x11/desktop-managers/kde5.nix
index 70dc1ac2a26a..2e9183da970a 100644
--- a/nixos/modules/services/x11/desktop-managers/kde5.nix
+++ b/nixos/modules/services/x11/desktop-managers/kde5.nix
@@ -22,26 +22,6 @@ in
         description = "Enable the Plasma 5 (KDE 5) desktop environment.";
       };
 
-      phonon = {
-
-        gstreamer = {
-          enable = mkOption {
-            type = types.bool;
-            default = true;
-            description = "Enable the GStreamer Phonon backend (recommended).";
-          };
-        };
-
-        vlc = {
-          enable = mkOption {
-            type = types.bool;
-            default = false;
-            description = "Enable the VLC Phonon backend.";
-          };
-        };
-
-      };
-
     };
 
   };
@@ -59,7 +39,7 @@ in
         # Load PulseAudio module for routing support.
         # See http://colin.guthr.ie/2009/10/so-how-does-the-kde-pulseaudio-support-work-anyway/
         ${optionalString config.hardware.pulseaudio.enable ''
-          ${config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1"
+          ${getBin config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1"
         ''}
 
         exec "${kde5.startkde}"
@@ -122,6 +102,9 @@ in
         pkgs.hicolor_icon_theme
 
         kde5.kde-gtk-config
+
+        pkgs.phonon-backend-gstreamer
+        pkgs.kde5.phonon-backend-gstreamer
       ]
 
       # Plasma 5.5 and later has a Breeze GTK theme.
@@ -131,37 +114,16 @@ in
       # Install Breeze icons if available
       ++ lib.optional (lib.hasAttr "breeze-icons" kde5) kde5.breeze-icons
 
+      # Install activity manager if available
+      ++ lib.optional (lib.hasAttr "kactivitymanagerd" kde5) kde5.kactivitymanagerd
+
       # Optional hardware support features
       ++ lib.optional config.hardware.bluetooth.enable kde5.bluedevil
       ++ lib.optional config.networking.networkmanager.enable kde5.plasma-nm
       ++ lib.optional config.hardware.pulseaudio.enable kde5.plasma-pa
       ++ lib.optional config.powerManagement.enable kde5.powerdevil
       ++ lib.optional config.services.colord.enable kde5.colord-kde
-      ++ lib.optionals config.services.samba.enable [ kde5.kdenetwork-filesharing pkgs.samba ]
-
-      ++ lib.optionals cfg.phonon.gstreamer.enable
-        [
-          pkgs.phonon_backend_gstreamer
-          pkgs.gst_all.gstreamer
-          pkgs.gst_all.gstPluginsBase
-          pkgs.gst_all.gstPluginsGood
-          pkgs.gst_all.gstPluginsUgly
-          pkgs.gst_all.gstPluginsBad
-          pkgs.gst_all.gstFfmpeg # for mp3 playback
-          pkgs.qt55.phonon-backend-gstreamer
-          pkgs.gst_all_1.gstreamer
-          pkgs.gst_all_1.gst-plugins-base
-          pkgs.gst_all_1.gst-plugins-good
-          pkgs.gst_all_1.gst-plugins-ugly
-          pkgs.gst_all_1.gst-plugins-bad
-          pkgs.gst_all_1.gst-libav # for mp3 playback
-        ]
-
-      ++ lib.optionals cfg.phonon.vlc.enable
-        [
-          pkgs.phonon_qt5_backend_vlc
-          pkgs.qt55.phonon-backend-vlc
-        ];
+      ++ lib.optionals config.services.samba.enable [ kde5.kdenetwork-filesharing pkgs.samba ];
 
     environment.pathsToLink = [ "/share" ];
 
@@ -170,17 +132,23 @@ in
       target = "X11/xkb";
     };
 
-    environment.profileRelativeEnvVars =
-      mkIf cfg.phonon.gstreamer.enable
-      {
-        GST_PLUGIN_SYSTEM_PATH = [ "/lib/gstreamer-0.10" ];
-        GST_PLUGIN_SYSTEM_PATH_1_0 = [ "/lib/gstreamer-1.0" ];
-      };
-
     # Enable GTK applications to load SVG icons
-    environment.variables = mkIf (lib.hasAttr "breeze-icons" kde5) {
-      GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache";
-    };
+    environment.variables =
+      {
+        GST_PLUGIN_SYSTEM_PATH_1_0 =
+          lib.makeSearchPath "/lib/gstreamer-1.0"
+          (builtins.map (pkg: pkg.out) (with pkgs.gst_all_1; [
+            gstreamer
+            gst-plugins-base
+            gst-plugins-good
+            gst-plugins-ugly
+            gst-plugins-bad
+            gst-libav # for mp3 playback
+          ]));
+      }
+      // (if (lib.hasAttr "breeze-icons" kde5)
+          then { GDK_PIXBUF_MODULE_FILE = "${pkgs.librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache"; }
+          else { });
 
     fonts.fonts = [ (kde5.oxygen-fonts or pkgs.noto-fonts) ];