summary refs log tree commit diff
path: root/pkgs/servers
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers')
-rwxr-xr-xpkgs/servers/apache-kafka/default.nix2
-rw-r--r--pkgs/servers/asterisk/default.nix61
-rw-r--r--pkgs/servers/asterisk/disable-download.patch12
-rw-r--r--pkgs/servers/asterisk/runtime-vardirs.patch50
-rw-r--r--pkgs/servers/dns/skydns/default.nix30
-rw-r--r--pkgs/servers/etcd/default.nix2
-rw-r--r--pkgs/servers/http/nginx/default.nix59
-rw-r--r--pkgs/servers/http/openresty/default.nix12
-rw-r--r--pkgs/servers/ldap/389/default.nix11
-rw-r--r--pkgs/servers/ldap/389/no-etc.patch62
-rw-r--r--pkgs/servers/mail/exim/default.nix2
-rw-r--r--pkgs/servers/mail/opensmtpd/default.nix18
-rw-r--r--pkgs/servers/monitoring/bosun/default.nix4
-rw-r--r--pkgs/servers/monitoring/bosun/scollector.nix4
-rw-r--r--pkgs/servers/monitoring/cadvisor/default.nix2
-rw-r--r--pkgs/servers/monitoring/prometheus/mesos_exporter/default.nix2
-rw-r--r--pkgs/servers/monitoring/prometheus/statsd_bridge/default.nix2
-rw-r--r--pkgs/servers/monitoring/sensu/default.nix3
-rw-r--r--pkgs/servers/mpd/clientlib.nix14
-rw-r--r--pkgs/servers/mpd/default.nix14
-rw-r--r--pkgs/servers/nosql/mongodb/default.nix4
-rw-r--r--pkgs/servers/nosql/rethinkdb/default.nix12
-rw-r--r--pkgs/servers/osrm-backend/default.nix2
-rw-r--r--pkgs/servers/plex/default.nix65
-rw-r--r--pkgs/servers/pulseaudio/caps-fix.patch13
-rw-r--r--pkgs/servers/pulseaudio/default.nix174
-rw-r--r--pkgs/servers/rippled/default.nix6
-rw-r--r--pkgs/servers/samba/4.x.nix10
-rw-r--r--pkgs/servers/search/elasticsearch/plugins.nix17
-rw-r--r--pkgs/servers/sql/mariadb/default.nix14
-rw-r--r--pkgs/servers/sql/pgpool/default.nix2
-rw-r--r--pkgs/servers/sslh/default.nix4
-rw-r--r--pkgs/servers/varnish/default.nix10
-rw-r--r--pkgs/servers/x11/xorg/overrides.nix8
-rw-r--r--pkgs/servers/x11/xorg/xorgserver-xkbcomp-path.patch22
35 files changed, 530 insertions, 199 deletions
diff --git a/pkgs/servers/apache-kafka/default.nix b/pkgs/servers/apache-kafka/default.nix
index f3d0a43c4cf..06f8c513063 100755
--- a/pkgs/servers/apache-kafka/default.nix
+++ b/pkgs/servers/apache-kafka/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
     # allow us the specify logging directory using env
     substituteInPlace $out/bin/kafka-run-class.sh \
-      --replace 'LOG_DIR=$base_dir/logs' 'LOG_DIR=$KAFKA_LOG_DIR'
+      --replace 'LOG_DIR="$base_dir/logs"' 'LOG_DIR="$KAFKA_LOG_DIR"'
 
     for p in $out/bin\/*.sh; do
       wrapProgram $p \
diff --git a/pkgs/servers/asterisk/default.nix b/pkgs/servers/asterisk/default.nix
new file mode 100644
index 00000000000..c37292d385f
--- /dev/null
+++ b/pkgs/servers/asterisk/default.nix
@@ -0,0 +1,61 @@
+{ stdenv, fetchurl, fetchgit, jansson, libxml2, libxslt, ncurses, openssl, sqlite, utillinux }:
+
+stdenv.mkDerivation rec {
+  name = "asterisk-${version}";
+  version = "13.3.2";
+
+  src = fetchurl {
+    url = "http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-${version}.tar.gz";
+    sha256 = "19dafvy6ch4v8949bjim64fff456k78156m30dy2yvhm94m5k1zz";
+  };
+
+  # Note that these sounds are included with the release tarball. They are
+  # provided here verbatim for the convenience of anyone wanting to build
+  # Asterisk from other sources.
+  coreSounds = fetchurl {
+    url = http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-core-sounds-en-gsm-1.4.26.tar.gz;
+    sha256 = "2300e3ed1d2ded6808a30a6ba71191e7784710613a5431afebbd0162eb4d5d73";
+  };
+  mohSounds = fetchurl {
+    url = http://downloads.asterisk.org/pub/telephony/sounds/releases/asterisk-moh-opsound-wav-2.03.tar.gz;
+    sha256 = "449fb810d16502c3052fedf02f7e77b36206ac5a145f3dacf4177843a2fcb538";
+  };
+  # TODO: Sounds for other languages could be added here
+
+  buildInputs = [ jansson libxml2 libxslt ncurses openssl sqlite utillinux ];
+
+  patches = [
+    # Disable downloading of sound files (we will fetch them
+    # ourselves if needed).
+    ./disable-download.patch
+
+    # We want the Makefile to install the default /var skeleton
+    # under ${out}/var but we also want to use /var at runtime.
+    # This patch changes the runtime behavior to look for state
+    # directories in /var rather than ${out}/var.
+    ./runtime-vardirs.patch
+  ];
+
+  # Use the following preConfigure section when building Asterisk from sources
+  # other than the release tarball.
+#   preConfigure = ''
+#     ln -s ${coreSounds} sounds/asterisk-core-sounds-en-gsm-1.4.26.tar.gz
+#     ln -s ${mohSounds} sounds/asterisk-moh-opsound-wav-2.03.tar.gz
+#   '';
+
+  # The default libdir is $PREFIX/usr/lib, which causes problems when paths
+  # compiled into Asterisk expect ${out}/usr/lib rather than ${out}/lib.
+  configureFlags = "--libdir=\${out}/lib";
+
+  postInstall = ''
+    # Install sample configuration files for this version of Asterisk
+    make samples
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Software implementation of a telephone private branch exchange (PBX)";
+    homepage = http://www.asterisk.org/;
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ auntie ];
+  };
+}
diff --git a/pkgs/servers/asterisk/disable-download.patch b/pkgs/servers/asterisk/disable-download.patch
new file mode 100644
index 00000000000..8b15ecdfaaa
--- /dev/null
+++ b/pkgs/servers/asterisk/disable-download.patch
@@ -0,0 +1,12 @@
+diff -ruN asterisk-13.2.0/sounds/Makefile asterisk-13.2.0-patched/sounds/Makefile
+--- asterisk-13.2.0/sounds/Makefile	2014-09-09 14:01:11.000000000 -0600
++++ asterisk-13.2.0-patched/sounds/Makefile	2015-03-31 16:12:00.549133670 -0600
+@@ -89,7 +89,7 @@
+ 	  ) && touch "$(1)$(if $(3),/$(3),)/$$@"; \
+ 	fi
+ 
+-asterisk-$(2)$(if $(3),-$(3),)-%.tar.gz: have_download
++asterisk-$(2)$(if $(3),-$(3),)-%.tar.gz:
+ ifneq ($(SOUNDS_CACHE_DIR),)
+ 	$(CMD_PREFIX) \
+ 	if test ! -f "$(1)$(if $(3),/$(3),)/.$$(subst .tar.gz,,$$@)"; then \
diff --git a/pkgs/servers/asterisk/runtime-vardirs.patch b/pkgs/servers/asterisk/runtime-vardirs.patch
new file mode 100644
index 00000000000..dfc00186d13
--- /dev/null
+++ b/pkgs/servers/asterisk/runtime-vardirs.patch
@@ -0,0 +1,50 @@
+diff -rupN asterisk-13.3.2/build_tools/make_defaults_h asterisk-13.3.2-patched/build_tools/make_defaults_h
+--- asterisk-13.3.2/build_tools/make_defaults_h	2012-01-30 14:21:16.000000000 -0700
++++ asterisk-13.3.2-patched/build_tools/make_defaults_h	2015-04-15 19:07:46.760351155 -0600
+@@ -1,4 +1,13 @@
+ #!/bin/sh
++
++ASTLOGDIR=/var/log/asterisk
++ASTVARRUNDIR=/var/run/asterisk
++ASTVARLIBDIR=/var/lib/asterisk
++ASTDBDIR=${ASTVARLIBDIR}
++ASTDATADIR=${ASTVARLIBDIR}
++AGI_DIR=${ASTDATADIR}/agi-bin
++ASTSPOOLDIR=/var/spool/asterisk
++
+ cat << END
+ /*
+  * defaults.h 
+@@ -9,21 +18,21 @@ cat << END
+ 
+ #define DEFAULT_CONFIG_DIR "${INSTALL_PATH}${ASTETCDIR}"
+ #define DEFAULT_MODULE_DIR "${INSTALL_PATH}${ASTMODDIR}"
+-#define DEFAULT_AGI_DIR    "${INSTALL_PATH}${AGI_DIR}"
+-#define DEFAULT_LOG_DIR    "${INSTALL_PATH}${ASTLOGDIR}"
++#define DEFAULT_AGI_DIR    "${AGI_DIR}"
++#define DEFAULT_LOG_DIR    "${ASTLOGDIR}"
+ 
+-#define DEFAULT_RUN_DIR    "${INSTALL_PATH}${ASTVARRUNDIR}"
+-#define DEFAULT_SOCKET     "${INSTALL_PATH}${ASTVARRUNDIR}/asterisk.ctl"
+-#define DEFAULT_PID        "${INSTALL_PATH}${ASTVARRUNDIR}/asterisk.pid"
++#define DEFAULT_RUN_DIR    "${ASTVARRUNDIR}"
++#define DEFAULT_SOCKET     "${ASTVARRUNDIR}/asterisk.ctl"
++#define DEFAULT_PID        "${ASTVARRUNDIR}/asterisk.pid"
+ 
+-#define DEFAULT_VAR_DIR    "${INSTALL_PATH}${ASTVARLIBDIR}"
+-#define DEFAULT_DB         "${INSTALL_PATH}${ASTDBDIR}/astdb"
++#define DEFAULT_VAR_DIR    "${ASTVARLIBDIR}"
++#define DEFAULT_DB         "${ASTDBDIR}/astdb"
+ 
+-#define DEFAULT_DATA_DIR   "${INSTALL_PATH}${ASTDATADIR}"
+-#define DEFAULT_KEY_DIR    "${INSTALL_PATH}${ASTDATADIR}/keys"
++#define DEFAULT_DATA_DIR   "${ASTDATADIR}"
++#define DEFAULT_KEY_DIR    "${ASTDATADIR}/keys"
+ 
+-#define DEFAULT_SPOOL_DIR  "${INSTALL_PATH}${ASTSPOOLDIR}"
+-#define DEFAULT_TMP_DIR    "${INSTALL_PATH}${ASTSPOOLDIR}/tmp"
++#define DEFAULT_SPOOL_DIR  "${ASTSPOOLDIR}"
++#define DEFAULT_TMP_DIR    "${ASTSPOOLDIR}/tmp"
+ 
+ #define DEFAULT_SBIN_DIR   "${INSTALL_PATH}${ASTSBINDIR}"
+ END
diff --git a/pkgs/servers/dns/skydns/default.nix b/pkgs/servers/dns/skydns/default.nix
new file mode 100644
index 00000000000..6536ad972b7
--- /dev/null
+++ b/pkgs/servers/dns/skydns/default.nix
@@ -0,0 +1,30 @@
+{ lib, goPackages, fetchFromGitHub, etcd }:
+
+with goPackages;
+
+buildGoPackage rec {
+  name = "skydns-${version}";
+  version = "2.1.0a";
+
+  goPackagePath = "github.com/skynetservices/skydns";
+
+  src = fetchFromGitHub {
+    owner = "skynetservices";
+    repo = "skydns";
+    rev = "f5141ee69309fb4c542d5a0b50fc7616370c5c06";
+    sha256 = "1bnc9r22kwvmn1bgz7zaidkjqm7pmw99bn5n87r76vcrd7n2a9pd";
+  };
+
+  buildInputs = with goPackages; [ go-etcd rcrowley.go-metrics influxdb-go go-systemd go-log dns stathat osext etcd ];
+  dontInstallSrc = true;
+
+  subPackages = [ "." ];
+
+  meta = with lib; {
+    description = "DNS service discovery for etcd";
+    homepage = https://github.com/skynetservices/skydns;
+    license = licenses.mit;
+    maintainers = with maintainers; [ offline ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/servers/etcd/default.nix b/pkgs/servers/etcd/default.nix
index abec19663ff..89ea70d46c5 100644
--- a/pkgs/servers/etcd/default.nix
+++ b/pkgs/servers/etcd/default.nix
@@ -15,8 +15,6 @@ buildGoPackage rec {
 
   subPackages = [ "./" ];
 
-  dontInstallSrc = true;
-
   meta = with lib; {
     description = "A highly-available key value store for shared configuration and service discovery";
     homepage = http://coreos.com/using-coreos/etcd/;
diff --git a/pkgs/servers/http/nginx/default.nix b/pkgs/servers/http/nginx/default.nix
index 456580cc199..fe500bf3462 100644
--- a/pkgs/servers/http/nginx/default.nix
+++ b/pkgs/servers/http/nginx/default.nix
@@ -7,22 +7,23 @@
 , echo ? false
 , ngx_lua ? false
 , set_misc ? false
+, fluent ? false
 }:
 
 with stdenv.lib;
 
 let
-  version = "1.6.3";
+  version = "1.8.0";
   mainSrc = fetchurl {
     url = "http://nginx.org/download/nginx-${version}.tar.gz";
-    sha256 = "0mz7nx1ffw4f024yb4w9kpjd33z1f16zmq9iyd160kbf6rdyk60a";
+    sha256 = "1mgkkmmwkhmpn68sdvbd73ssv6lpqhh864fsyvc1ij4hk4is3k13";
   };
 
   rtmp-ext = fetchFromGitHub {
     owner = "arut";
     repo = "nginx-rtmp-module";
-    rev = "v1.1.5";
-    sha256 = "1d9ws4prxz22yq3nhh5h18jrs331zivrdh784l6wznc1chg3gphn";
+    rev = "v1.1.7";
+    sha256 = "0i0fa1znkj7cipy5nlkw4k40klhp9jzk28wxy2vrvd2jvh91x3ma";
   };
 
   dav-ext = fetchFromGitHub {
@@ -42,38 +43,46 @@ let
   moreheaders-ext = fetchFromGitHub {
     owner = "openresty";
     repo = "headers-more-nginx-module";
-    rev = "v0.25";
-    sha256 = "1d71y1i0smi4gkzz731fhn58gr03b3s6jz6ipnfzxxaizmgxm3rb";
+    rev = "v0.26";
+    sha256 = "01wkqhk8mk8jgmzi7jbzmg5kamffx3lmhj5yfwryvnvs6xqs74wn";
   };
 
   echo-ext = fetchFromGitHub {
     owner = "openresty";
     repo = "echo-nginx-module";
-    rev = "v0.56";
-    sha256 = "03vaf1ffhkj2s089f90h45n079h3zw47h6y5zpk752f4ydiagpgd";
-  };
-
-  develkit-ext = fetchFromGitHub {
-    owner = "simpl";
-    repo = "ngx_devel_kit";
-    rev = "v0.2.19";
-    sha256 = "1cqcasp4lc6yq5pihfcdw4vp4wicngvdc3nqg3bg52r63c1qrz76";
+    rev = "v0.57";
+    sha256 = "1q0f0zprcn0ypl2qh964cq186l3f40p0z7n7x22m8cxj367vf000";
   };
 
   lua-ext = fetchFromGitHub {
     owner = "openresty";
     repo = "lua-nginx-module";
-    rev = "v0.9.12";
-    sha256 = "0r07q1n3nvi7m3l8zk7nfk0z9kjhqknav61ys9lshh2ylsmz1lf4";
+    rev = "v0.9.15";
+    sha256 = "0kicfs0gyfb5fhjmrwr6p09c5x6g0jwsh0wg5bsp3p209rnbq94q";
   };
 
   set-misc-ext = fetchFromGitHub {
     owner = "openresty";
     repo = "set-misc-nginx-module";
-    rev = "v0.27";
-    sha256 = "1bd1isacsiay73nc2jlp0wky32l42a3sjskvfa1082l12g0p1x39";
+    rev = "v0.28";
+    sha256 = "1vixj60q0liri7k5ax85grj7q9vvgybkx421bwphbhai5xrjip96";
   };
 
+  fluentd = fetchFromGitHub {
+    owner = "fluent";
+    repo = "nginx-fluentd-module";
+    rev = "8af234043059c857be27879bc547c141eafd5c13";
+    sha256 = "1ycb5zd9sw60ra53jpak1m73zwrjikwhrrh9q6266h1mlyns7zxm";
+  };
+
+  develkit-ext = fetchFromGitHub {
+    owner = "simpl";
+    repo = "ngx_devel_kit";
+    rev = "v0.2.19";
+    sha256 = "1cqcasp4lc6yq5pihfcdw4vp4wicngvdc3nqg3bg52r63c1qrz76";
+  };
+
+
 in
 
 stdenv.mkDerivation rec {
@@ -91,6 +100,11 @@ stdenv.mkDerivation rec {
   patches = if syslog then [ "${syslog-ext}/syslog-1.5.6.patch" ] else [];
 
   configureFlags = [
+    "--with-select_module"
+    "--with-poll_module"
+    "--with-aio_module"
+    "--with-threads"
+    "--with-file-aio"
     "--with-http_ssl_module"
     "--with-http_spdy_module"
     "--with-http_realip_module"
@@ -119,7 +133,8 @@ stdenv.mkDerivation rec {
     ++ optional echo "--add-module=${echo-ext}"
     ++ optional ngx_lua "--add-module=${develkit-ext} --add-module=${lua-ext}"
     ++ optional set_misc "--add-module=${set-misc-ext}"
-    ++ optional (elem stdenv.system (with platforms; linux ++ freebsd)) "--with-file-aio";
+    ++ optional (elem stdenv.system (with platforms; linux ++ freebsd)) "--with-file-aio"
+    ++ optional fluent "--add-module=${fluentd}";
 
 
   additionalFlags = optionalString stdenv.isDarwin "-Wno-error=deprecated-declarations -Wno-error=conditional-uninitialized";
@@ -128,10 +143,6 @@ stdenv.mkDerivation rec {
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${libxml2}/include/libxml2 $additionalFlags"
   '';
 
-  postInstall = ''
-    mv $out/sbin $out/bin
-  '';
-
   meta = {
     description = "A reverse proxy and lightweight webserver";
     homepage    = http://nginx.org;
diff --git a/pkgs/servers/http/openresty/default.nix b/pkgs/servers/http/openresty/default.nix
index 65c81c455b9..8444d49b91e 100644
--- a/pkgs/servers/http/openresty/default.nix
+++ b/pkgs/servers/http/openresty/default.nix
@@ -7,11 +7,11 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   name = "openresty-${version}";
-  version = "1.7.7.1";
+  version = "1.7.10.1";
 
   src = fetchurl {
     url = "http://openresty.org/download/ngx_openresty-${version}.tar.gz";
-    sha256 = "1m541k2lys3155f0r94abgcmm2hgvv56q0i4fk58w6fa8n4h62z0";
+    sha256 = "0yg6pkagkkga6ly6fgmfcf557r2b4m75gyn6a7p9qcamb4zdgl2g";
   };
 
   buildInputs = [ openssl zlib pcre libxml2 libxslt gd geoip perl ];
@@ -40,13 +40,9 @@ stdenv.mkDerivation rec {
   ];
 
   postInstall = ''
-    mv $out/nginx/sbin $out/bin
-    mv $out/bin/sbin $out/sbin
-
+    mv $out/nginx/sbin/nginx $out/bin
     mv $out/luajit/bin/luajit-2.1.0-alpha $out/bin/luajit-openresty
-    ln -s $out/sbin/nginx $out/sbin/openresty
-    ln -s $out/sbin/nginx $out/bin/openresty
-    ln -s $out/sbin/nginx $out/bin/nginx
+    ln -s $out/bin/nginx $out/bin/openresty
   '';
 
   preConfigure = ''
diff --git a/pkgs/servers/ldap/389/default.nix b/pkgs/servers/ldap/389/default.nix
index f2ed57b4eb7..685d365ed18 100644
--- a/pkgs/servers/ldap/389/default.nix
+++ b/pkgs/servers/ldap/389/default.nix
@@ -2,14 +2,14 @@
 , svrcore, icu, net_snmp, kerberos, pcre, perlPackages
 }:
 let
-  version = "1.3.3.5";
+  version = "1.3.3.9";
 in
 stdenv.mkDerivation rec {
   name = "389-ds-base-${version}";
 
   src = fetchurl {
     url = "http://directory.fedoraproject.org/binaries/${name}.tar.bz2";
-    sha256 = "09w81salyr56njsvq9p96ijrrs0vwsczd43jf6384ylzj1jrxxl5";
+    sha256 = "1qqwv5j60f38hz4xpbzn4pixhkj07yjzbp7kz7cvfkgvdwy9jqxx";
   };
 
   buildInputs = [
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   # TODO: Fix bin/ds-logpipe.py, bin/logconv, bin/cl-dump
 
-  patches = [ ./no-etc.patch ./perl-path.patch ];
+  patches = [ ./perl-path.patch ];
 
   preConfigure = ''
     # Create perl paths for library imports in perl scripts
@@ -44,6 +44,11 @@ stdenv.mkDerivation rec {
     mkdir -p $out/lib/dirsrv
   '';
 
+  installFlags = [
+    "sysconfdir=\${out}/etc"
+    "localstatedir=\${TMPDIR}"
+  ];
+
   passthru.version = version;
 
   meta = with stdenv.lib; {
diff --git a/pkgs/servers/ldap/389/no-etc.patch b/pkgs/servers/ldap/389/no-etc.patch
deleted file mode 100644
index a894ffd4005..00000000000
--- a/pkgs/servers/ldap/389/no-etc.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From bcdd781b01beba59b9f6993355732070b9487603 Mon Sep 17 00:00:00 2001
-From: "William A. Kennington III" <william@wkennington.com>
-Date: Fri, 9 Jan 2015 14:51:46 -0800
-Subject: [PATCH 1/2] Makefile: Don't install files to /etc or /var
-
----
- Makefile.in | 17 ++++++++---------
- 1 file changed, 8 insertions(+), 9 deletions(-)
-
-diff --git a/Makefile.in b/Makefile.in
-index 24a9ddf..c97d1e1 100644
---- a/Makefile.in
-+++ b/Makefile.in
-@@ -169,15 +169,14 @@ am__uninstall_files_from_dir = { \
- am__installdirs = "$(DESTDIR)$(serverdir)" \
- 	"$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" \
- 	"$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" \
--	"$(DESTDIR)$(initdir)" "$(DESTDIR)$(sbindir)" \
-+	"$(DESTDIR)$(sbindir)" \
- 	"$(DESTDIR)$(taskdir)" "$(DESTDIR)$(updatedir)" \
- 	"$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" \
--	"$(DESTDIR)$(configdir)" "$(DESTDIR)$(infdir)" \
--	"$(DESTDIR)$(initconfigdir)" "$(DESTDIR)$(mibdir)" \
-+	"$(DESTDIR)$(infdir)" \
-+	"$(DESTDIR)$(mibdir)" \
- 	"$(DESTDIR)$(propertydir)" "$(DESTDIR)$(perldir)" \
- 	"$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(propertydir)" \
- 	"$(DESTDIR)$(pythondir)" "$(DESTDIR)$(sampledatadir)" \
--	"$(DESTDIR)$(schemadir)" "$(DESTDIR)$(systemdsystemunitdir)" \
- 	"$(DESTDIR)$(updatedir)" "$(DESTDIR)$(serverincdir)"
- LTLIBRARIES = $(server_LTLIBRARIES) $(serverplugin_LTLIBRARIES)
- am__DEPENDENCIES_1 =
-@@ -10207,7 +10206,7 @@ check: $(BUILT_SOURCES)
- all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) \
- 		$(MANS) $(DATA) $(HEADERS) config.h
- installdirs:
--	for dir in "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(taskdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(infdir)" "$(DESTDIR)$(initconfigdir)" "$(DESTDIR)$(mibdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(perldir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(pythondir)" "$(DESTDIR)$(sampledatadir)" "$(DESTDIR)$(schemadir)" "$(DESTDIR)$(systemdsystemunitdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(serverincdir)"; do \
-+	for dir in "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(taskdir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(infdir)" "$(DESTDIR)$(mibdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(perldir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(pythondir)" "$(DESTDIR)$(sampledatadir)" "$(DESTDIR)$(updatedir)" "$(DESTDIR)$(serverincdir)"; do \
- 	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
- 	done
- install: $(BUILT_SOURCES)
-@@ -10363,13 +10362,13 @@ info: info-am
- 
- info-am:
- 
--install-data-am: install-configDATA install-infDATA \
--	install-initSCRIPTS install-initconfigDATA install-man \
-+install-data-am: install-infDATA \
-+	install-man \
- 	install-mibDATA install-nodist_propertyDATA install-perlDATA \
- 	install-pkgconfigDATA install-propertyDATA install-pythonDATA \
--	install-sampledataDATA install-schemaDATA \
-+	install-sampledataDATA \
- 	install-serverLTLIBRARIES install-serverincHEADERS \
--	install-serverpluginLTLIBRARIES install-systemdsystemunitDATA \
-+	install-serverpluginLTLIBRARIES \
- 	install-taskSCRIPTS install-updateDATA install-updateSCRIPTS
- 
- install-dvi: install-dvi-am
--- 
-2.1.4
-
diff --git a/pkgs/servers/mail/exim/default.nix b/pkgs/servers/mail/exim/default.nix
index ae4e1d6f245..3dd0463b604 100644
--- a/pkgs/servers/mail/exim/default.nix
+++ b/pkgs/servers/mail/exim/default.nix
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://exim.org/";
-    description = "Exim is a mail transfer agent (MTA) for hosts that are running Unix or Unix-like operating systems.";
+    description = "A mail transfer agent (MTA) for hosts that are running Unix or Unix-like operating systems";
     license = stdenv.lib.licenses.gpl3;
     platforms = stdenv.lib.platforms.linux;
     maintainers = [ stdenv.lib.maintainers.tv ];
diff --git a/pkgs/servers/mail/opensmtpd/default.nix b/pkgs/servers/mail/opensmtpd/default.nix
index d2c19a2a00b..b796e12e9f4 100644
--- a/pkgs/servers/mail/opensmtpd/default.nix
+++ b/pkgs/servers/mail/opensmtpd/default.nix
@@ -1,17 +1,22 @@
-{ stdenv, fetchurl, libasr, libevent, zlib, openssl, db, bison, pam }:
+{ stdenv, fetchurl, autoconf, automake, libtool, bison
+, libasr, libevent, zlib, openssl, db, pam
+}:
 
 stdenv.mkDerivation rec {
   name = "opensmtpd-${version}";
-  version = "5.4.4p1";
+  version = "5.4.5p1";
 
-  buildInputs = [ libasr libevent zlib openssl db bison pam ];
+  nativeBuildInputs = [ autoconf automake libtool bison ];
+  buildInputs = [ libasr libevent zlib openssl db pam ];
 
   src = fetchurl {
     url = "http://www.opensmtpd.org/archives/${name}.tar.gz";
-    sha256 = "1gcfdmpkk892wnnhwc2nb559bwl3k892w7saj4q8m6jfll53660i";
+    sha256 = "15sicrpqsgg72igdckkwpmbgrapcjbfjsdrvm0zl8z13kgp6r4ks";
   };
 
   configureFlags = [
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
     "--with-mantype=doc"
     "--with-pam"
     "--without-bsd-auth"
@@ -21,6 +26,11 @@ stdenv.mkDerivation rec {
     "--with-ca-file=/etc/ssl/certs/ca-bundle.crt"
   ];
 
+  installFlags = [
+    "sysconfdir=\${out}/etc"
+    "localstatedir=\${TMPDIR}"
+  ];
+
   meta = {
     homepage = https://www.opensmtpd.org/;
     description = ''
diff --git a/pkgs/servers/monitoring/bosun/default.nix b/pkgs/servers/monitoring/bosun/default.nix
index d37a4ff5b70..4ab9148118c 100644
--- a/pkgs/servers/monitoring/bosun/default.nix
+++ b/pkgs/servers/monitoring/bosun/default.nix
@@ -3,14 +3,14 @@
 with goPackages;
 
 buildGoPackage rec {
-  rev = "20150311224711";
+  rev = "20150409220449";
   name = "bosun-${rev}";
   goPackagePath = "bosun.org";
   src = fetchFromGitHub {
     inherit rev;
     owner = "bosun-monitor";
     repo = "bosun";
-    sha256 = "1nzzmlbiah7lpkm5n7yzxv1wmcxg8pszlzzsdvb7ccy0agpihxjg";
+    sha256 = "02bvq9hx2h4pgjclv09nm0al8ybvq0syhyhn5cvw0wgnn9bwn5mb";
   };
   subPackages = [ "cmd/bosun" ];
 
diff --git a/pkgs/servers/monitoring/bosun/scollector.nix b/pkgs/servers/monitoring/bosun/scollector.nix
index ba6b0f369b9..9f432f7f8c1 100644
--- a/pkgs/servers/monitoring/bosun/scollector.nix
+++ b/pkgs/servers/monitoring/bosun/scollector.nix
@@ -3,14 +3,14 @@
 with goPackages;
 
 buildGoPackage rec {
-  rev = "20150311224711";
+  rev = "20150409220449";
   name = "bosun-${rev}";
   goPackagePath = "bosun.org";
   src = fetchFromGitHub {
     inherit rev;
     owner = "bosun-monitor";
     repo = "bosun";
-    sha256 = "1nzzmlbiah7lpkm5n7yzxv1wmcxg8pszlzzsdvb7ccy0agpihxjg";
+    sha256 = "02bvq9hx2h4pgjclv09nm0al8ybvq0syhyhn5cvw0wgnn9bwn5mb";
   };
   subPackages = [ "cmd/scollector" ];
 
diff --git a/pkgs/servers/monitoring/cadvisor/default.nix b/pkgs/servers/monitoring/cadvisor/default.nix
index 1e818a508d9..c0126fda572 100644
--- a/pkgs/servers/monitoring/cadvisor/default.nix
+++ b/pkgs/servers/monitoring/cadvisor/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with stdenv.lib; {
-    description = "Analyzes resource usage and performance characteristics of running docker containers.";
+    description = "Analyzes resource usage and performance characteristics of running docker containers";
     homepage = https://github.com/google/cadvisor;
     license = licenses.asl20;
     maintainers = with maintainers; [ offline ];
diff --git a/pkgs/servers/monitoring/prometheus/mesos_exporter/default.nix b/pkgs/servers/monitoring/prometheus/mesos_exporter/default.nix
index c8793e17abb..e816f346e53 100644
--- a/pkgs/servers/monitoring/prometheus/mesos_exporter/default.nix
+++ b/pkgs/servers/monitoring/prometheus/mesos_exporter/default.nix
@@ -17,7 +17,7 @@ goPackages.buildGoPackage rec {
   meta = with lib; {
     description = "Export Mesos metrics to Prometheus";
     homepage = https://github.com/prometheus/mesos_exporter;
-    licenses = licenses.asl20;
+    license = licenses.asl20;
     maintainers = with maintainers; [ benley ];
     platforms = platforms.unix;
   };
diff --git a/pkgs/servers/monitoring/prometheus/statsd_bridge/default.nix b/pkgs/servers/monitoring/prometheus/statsd_bridge/default.nix
index 231aa31802c..da15952f0f3 100644
--- a/pkgs/servers/monitoring/prometheus/statsd_bridge/default.nix
+++ b/pkgs/servers/monitoring/prometheus/statsd_bridge/default.nix
@@ -20,7 +20,7 @@ goPackages.buildGoPackage rec {
   meta = with lib; {
     description = "Receives StatsD-style metrics and exports them to Prometheus";
     homepage = https://github.com/prometheus/statsd_bridge;
-    licenses = licenses.asl20;
+    license = licenses.asl20;
     maintainers = with maintainers; [ benley ];
     platforms = platforms.unix;
   };
diff --git a/pkgs/servers/monitoring/sensu/default.nix b/pkgs/servers/monitoring/sensu/default.nix
index 2785898bed5..38e59a39f38 100644
--- a/pkgs/servers/monitoring/sensu/default.nix
+++ b/pkgs/servers/monitoring/sensu/default.nix
@@ -9,8 +9,7 @@
     gemset = ./gemset.nix;
 
     meta = with lib; {
-      description = "A monitoring framework that aims to be simple, malleable,
-and scalable.";
+      description = "A monitoring framework that aims to be simple, malleable, and scalable";
       homepage    = http://sensuapp.org/;
       license     = with licenses; mit;
       maintainers = with maintainers; [ theuni ];
diff --git a/pkgs/servers/mpd/clientlib.nix b/pkgs/servers/mpd/clientlib.nix
index bbbe54b95fd..41e3b547f70 100644
--- a/pkgs/servers/mpd/clientlib.nix
+++ b/pkgs/servers/mpd/clientlib.nix
@@ -6,21 +6,21 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://www.musicpd.org/download/libmpdclient/2/${name}.tar.xz";
-    sha256 = "1jlrfqxqq3gscwrppr2h0xqxd5abl1ypwpwpwnpxs6p9c2jppjbw";
+    sha256 = "10pzs9z815a8hgbbbiliapyiw82bnplsccj5irgqjw5f5plcs22g";
   };
 
   buildInputs = [ doxygen ];
 
   passthru = {
     majorVersion = "2";
-    minorVersion = "9";
+    minorVersion = "10";
   };
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Client library for MPD (music player daemon)";
-    homepage = http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki;
-    license = stdenv.lib.licenses.gpl2;
-    platforms = with stdenv.lib.platforms; unix;
-    maintainers = [ stdenv.lib.maintainers.mornfall ];
+    homepage = http://www.musicpd.org/libs/libmpdclient/;
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ mornfall emery ];
   };
 }
diff --git a/pkgs/servers/mpd/default.nix b/pkgs/servers/mpd/default.nix
index 0078b4af96f..36b78388980 100644
--- a/pkgs/servers/mpd/default.nix
+++ b/pkgs/servers/mpd/default.nix
@@ -21,6 +21,8 @@
 , jackSupport ? true, jack2
 , gmeSupport ? true, game-music-emu
 , icuSupport ? true, icu
+, clientSupport ? false, mpd_clientlib
+, opusSupport ? true, libopus
 }:
 
 let
@@ -32,8 +34,8 @@ let
 in stdenv.mkDerivation rec {
   name = "mpd-${major}.${minor}";
   src = fetchurl {
-    url    = "http://www.musicpd.org/download/mpd/${major}/${name}.tar.gz";
-    sha256 = "1j3cv8b76bfj3ddpd29v3apb5025i87y5h5b4lrs2g5vqsgpvb6y";
+    url    = "http://www.musicpd.org/download/mpd/${major}/${name}.tar.xz";
+    sha256 = "0vzj365s4j0pw5w37lfhx3dmpkdp85driravsvx8rlrw0lii91a7";
   };
 
   buildInputs = [ pkgconfig glib boost ]
@@ -61,7 +63,9 @@ in stdenv.mkDerivation rec {
     ++ opt pulseaudioSupport pulseaudio
     ++ opt jackSupport jack2
     ++ opt gmeSupport game-music-emu
-    ++ opt icuSupport icu;
+    ++ opt icuSupport icu
+    ++ opt clientSupport mpd_clientlib
+    ++ opt opusSupport libopus;
 
   configureFlags =
     [ (mkFlag (!stdenv.isDarwin && alsaSupport) "alsa")
@@ -88,6 +92,8 @@ in stdenv.mkDerivation rec {
       (mkFlag stdenv.isDarwin "osx")
       (mkFlag icuSupport "icu")
       (mkFlag gmeSupport "gme")
+      (mkFlag clientSupport "libmpdclient")
+      (mkFlag opusSupport "opus")
       "--enable-debug"
     ]
     ++ opt stdenv.isLinux
@@ -101,7 +107,7 @@ in stdenv.mkDerivation rec {
     description = "A flexible, powerful daemon for playing music";
     homepage    = http://mpd.wikia.com/wiki/Music_Player_Daemon_Wiki;
     license     = licenses.gpl2;
-    maintainers = with maintainers; [ astsmtl fuuzetsu ];
+    maintainers = with maintainers; [ astsmtl fuuzetsu emery ];
     platforms   = platforms.unix;
 
     longDescription = ''
diff --git a/pkgs/servers/nosql/mongodb/default.nix b/pkgs/servers/nosql/mongodb/default.nix
index 303159cb7f4..ef08dd3747f 100644
--- a/pkgs/servers/nosql/mongodb/default.nix
+++ b/pkgs/servers/nosql/mongodb/default.nix
@@ -4,7 +4,7 @@
 
 with stdenv.lib;
 
-let version = "3.0.1";
+let version = "3.0.2";
     system-libraries = [
       "pcre"
       "wiredtiger"
@@ -36,7 +36,7 @@ in stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "http://downloads.mongodb.org/src/mongodb-src-r${version}.tar.gz";
-    sha256 = "04qjw7b98h37g8rcih7va3rvg2z95ly38bg181a4nfkak50hd638";
+    sha256 = "16c3cr7l8ddziavmxrg2aq9bp1knnscy57xx5zsvz6yv7hh24181";
   };
 
   nativeBuildInputs = [ scons ];
diff --git a/pkgs/servers/nosql/rethinkdb/default.nix b/pkgs/servers/nosql/rethinkdb/default.nix
index 1c8eac99737..79343b04483 100644
--- a/pkgs/servers/nosql/rethinkdb/default.nix
+++ b/pkgs/servers/nosql/rethinkdb/default.nix
@@ -1,11 +1,13 @@
-{ stdenv, fetchurl, which, protobuf, gperftools, boost, zlib, curl, python, m4 }:
+{ stdenv, fetchurl, which, protobuf, gperftools
+, boost, zlib, curl, python, m4, icu, jemalloc }:
 
 stdenv.mkDerivation rec {
-  name = "rethinkdb-1.15.2";
+  name = "rethinkdb-${version}";
+  version = "2.0.0-1";
 
   src = fetchurl {
     url = "http://download.rethinkdb.com/dist/${name}.tgz";
-    sha256 = "1fpx9apqm62i332q2isanpdql8gwwab4qxwzrspqwgcka9zd6gy3";
+    sha256 = "0fbxs6gmlmgkbfrmi0f4xyr3vqwylr6i7fa4p68y12qy6kv7q9pc";
   };
 
   preConfigure = ''
@@ -13,9 +15,9 @@ stdenv.mkDerivation rec {
     patchShebangs .
   '';
 
-  configureFlags = "--lib-path ${gperftools}/lib";
+  configureFlags = "--lib-path ${gperftools}/lib --lib-path ${jemalloc}/lib";
 
-  buildInputs = [ protobuf boost zlib curl ];
+  buildInputs = [ protobuf boost zlib curl icu jemalloc ];
 
   nativeBuildInputs = [ which m4 python ];
 
diff --git a/pkgs/servers/osrm-backend/default.nix b/pkgs/servers/osrm-backend/default.nix
index 37d3650f683..3e9e2158524 100644
--- a/pkgs/servers/osrm-backend/default.nix
+++ b/pkgs/servers/osrm-backend/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = https://github.com/Project-OSRM/osrm-backend/wiki;
-    description = "Open Source Routing Machine computes shortest paths in a graph. It was designed to run well with map data from the Openstreetmap Project.";
+    description = "Open Source Routing Machine computes shortest paths in a graph. It was designed to run well with map data from the Openstreetmap Project";
     license = stdenv.lib.licenses.bsd2;
   };
 }
diff --git a/pkgs/servers/plex/default.nix b/pkgs/servers/plex/default.nix
new file mode 100644
index 00000000000..62334de1b56
--- /dev/null
+++ b/pkgs/servers/plex/default.nix
@@ -0,0 +1,65 @@
+{ stdenv, fetchurl, rpmextract, glibc
+, dataDir ? "/var/lib/plex" # Plex's data directory must be baked into the package due to symlinks.
+}:
+
+stdenv.mkDerivation rec {
+  name = "plex-${version}";
+  version = "0.9.11.16.958";
+  vsnHash = "80f1748";
+
+  src = fetchurl {
+    url = "https://downloads.plex.tv/plex-media-server/${version}-${vsnHash}/plexmediaserver-${version}-${vsnHash}.x86_64.rpm";
+    sha256 = "1wrl654nk10i9p01cgy9fqiqalxyl718qhp4kjnxvcwafayxkp26";
+  };
+
+  buildInputs = [ rpmextract glibc ];
+
+  phases = [ "unpackPhase" "installPhase" "fixupPhase" "distPhase" ];
+
+  unpackPhase = ''
+    rpmextract $src
+  '';
+
+  installPhase = ''
+    install -d $out/usr/lib
+    cp -dr --no-preserve='ownership' usr/lib/plexmediaserver $out/usr/lib/
+
+    # Now we need to patch up the executables and libraries to work on Nix.
+    # Side note: PLEASE don't put spaces in your binary names. This is stupid.
+    for bin in "Plex Media Server" "Plex DLNA Server" "Plex Media Scanner"; do
+      patchelf --set-interpreter "${glibc}/lib/ld-linux-x86-64.so.2" "$out/usr/lib/plexmediaserver/$bin"
+      patchelf --set-rpath "$out/usr/lib/plexmediaserver" "$out/usr/lib/plexmediaserver/$bin"
+    done
+
+    find $out/usr/lib/plexmediaserver/Resources -type f -a -perm +0100 \
+        -print -exec patchelf --set-interpreter "${glibc}/lib/ld-linux-x86-64.so.2" '{}' \;
+
+
+    # Our next problem is the "Resources" directory in /usr/lib/plexmediaserver.
+    # This is ostensibly a skeleton directory, which contains files that Plex
+    # copies into its folder in /var. Unfortunately, there are some SQLite
+    # databases in the directory that are opened at startup. Since these
+    # database files are read-only, SQLite chokes and Plex fails to start. To
+    # solve this, we keep the resources directory in the Nix store, but we
+    # rename the database files and replace the originals with symlinks to
+    # /var/lib/plex. Then, in the systemd unit, the base database files are
+    # copied to /var/lib/plex before starting Plex.
+    RSC=$out/usr/lib/plexmediaserver/Resources
+    for db in "com.plexapp.plugins.library.db"; do
+        mv $RSC/$db $RSC/base_$db
+        ln -s ${dataDir}/.skeleton/$db $RSC/$db
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://plex.tv/;
+    license = licenses.unfree;
+    platforms = platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ forkk ];
+    description = "Media / DLNA server";
+    longDescription = ''
+      Plex is a media server which allows you to store your media and play it
+      back across many different devices.
+    '';
+  };
+}
diff --git a/pkgs/servers/pulseaudio/caps-fix.patch b/pkgs/servers/pulseaudio/caps-fix.patch
new file mode 100644
index 00000000000..1d69a16982f
--- /dev/null
+++ b/pkgs/servers/pulseaudio/caps-fix.patch
@@ -0,0 +1,13 @@
+diff --git a/configure.ac b/configure.ac
+index 3c71472..71b5c3d 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -620,6 +620,8 @@ AC_ARG_WITH([caps],
+ 
+ if test "x${with_caps}" != "xno"; then
+     AC_SEARCH_LIBS([cap_init], [cap], [], [])
++    AS_IF([test "x${with_caps}" != "xyes" -a "x${with_caps}" != "x"],
++          LIBS="-L${with_caps}/lib $LIBS")
+ 
+     # Only give an error on hosts that we know could support capabilities
+     AC_CHECK_HEADERS([sys/capability.h], [], [
diff --git a/pkgs/servers/pulseaudio/default.nix b/pkgs/servers/pulseaudio/default.nix
index 4228f8b1eab..b031b0b4508 100644
--- a/pkgs/servers/pulseaudio/default.nix
+++ b/pkgs/servers/pulseaudio/default.nix
@@ -1,34 +1,99 @@
-{ stdenv, fetchurl, fetchpatch, pkgconfig, gnum4, gdbm, libtool, glib, dbus, avahi
-, gconf, gtk, intltool, gettext, alsaLib, libsamplerate, libsndfile, speex
-, bluez, sbc, udev, libcap, json_c
-, jackaudioSupport ? false, jack2 ? null
-, x11Support ? false, xlibs
-, useSystemd ? false, systemd ? null
-, ossWrapper ? false }:
+{ stdenv, fetchurl, pkgconfig, intltool, automake, autoconf, libtool
+, json_c, libsndfile, gettext, check
 
-assert jackaudioSupport -> jack2 != null;
+# Optional Dependencies
+, xlibs ? null, libcap ? null, valgrind ? null, oss ? null, coreaudio ? null
+, alsaLib ? null, esound ? null, glib ? null, gtk3 ? null, gconf ? null
+, avahi ? null, libjack2 ? null, libasyncns ? null, lirc ? null, dbus ? null
+, sbc ? null, bluez5 ? null, udev ? null, openssl ? null, fftw ? null
+, speexdsp ? null, systemd ? null, webrtc-audio-processing ? null
 
+# Database selection
+, tdb ? null, gdbm ? null
+
+# Extra options
+, prefix ? ""
+}:
+
+let
+  mkFlag = trueStr: falseStr: cond: name: val:
+    if cond == null then null else
+      "--${if cond != false then trueStr else falseStr}${name}${if val != null && cond != false then "=${val}" else ""}";
+  mkEnable = mkFlag "enable-" "disable-";
+  mkWith = mkFlag "with-" "without-";
+  mkOther = mkFlag "" "" true;
+
+  shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (x: x == stdenv.system) pkg.meta.platforms then pkg else null;
+
+  libOnly = prefix == "lib";
+
+  hasXlibs = xlibs != null;
+
+  optLibcap = shouldUsePkg libcap;
+  hasCaps = optLibcap != null || stdenv.isFreeBSD; # Built-in on FreeBSD
+
+  optOss = if libOnly then null else shouldUsePkg oss;
+  hasOss = optOss != null || stdenv.isFreeBSD; # Built-in on FreeBSD
+
+  optCoreaudio = if libOnly then null else shouldUsePkg coreaudio;
+  optAlsaLib = if libOnly then null else shouldUsePkg alsaLib;
+  optEsound = if libOnly then null else shouldUsePkg esound;
+  optGlib = if libOnly then null else shouldUsePkg glib;
+  optGtk3 = if libOnly || hasXlibs then null else shouldUsePkg gtk3;
+  optGconf = if libOnly then null else shouldUsePkg gconf;
+  optAvahi = if libOnly then null else shouldUsePkg avahi;
+  optLibjack2 = if libOnly then null else shouldUsePkg libjack2;
+  optLibasyncns = shouldUsePkg libasyncns;
+  optLirc = if libOnly then null else shouldUsePkg lirc;
+  optDbus = shouldUsePkg dbus;
+  optSbc = if libOnly then null else shouldUsePkg sbc;
+  optBluez5 = if optDbus == null || optSbc == null then null
+    else shouldUsePkg bluez5;
+  optUdev = if libOnly then null else shouldUsePkg udev;
+  optOpenssl = if libOnly then null else shouldUsePkg openssl;
+  optFftw = shouldUsePkg fftw;
+  optSpeexdsp = shouldUsePkg speexdsp;
+  optSystemd = shouldUsePkg systemd;
+  optWebrtc-audio-processing = if libOnly then null else shouldUsePkg webrtc-audio-processing;
+  hasWebrtc = if libOnly then null else optWebrtc-audio-processing != null;
+
+  # Pick a database to use
+  databaseName = if tdb != null then "tdb" else
+    if gdbm != null then "gdbm" else "simple";
+  database = {
+    tdb = tdb;
+    gdbm = gdbm;
+    simple = null;
+  }.${databaseName};
+in
 stdenv.mkDerivation rec {
-  name = "pulseaudio-6.0";
+  name = "${prefix}pulseaudio-${version}";
+  version = "6.0";
 
   src = fetchurl {
-    url = "http://freedesktop.org/software/pulseaudio/releases/${name}.tar.xz";
+    url = "http://freedesktop.org/software/pulseaudio/releases/pulseaudio-${version}.tar.xz";
     sha256 = "1xpnfxa0d8pgf6b4qdgnkcvrvdxbbbjd5ync19h0f5hbp3h401mm";
   };
 
-  # Since `libpulse*.la' contain `-lgdbm' and `-lcap', it must be propagated.
-  propagatedBuildInputs
-    = [ gdbm ] ++ stdenv.lib.optionals stdenv.isLinux [ libcap ];
+  patches = [ ./caps-fix.patch ];
+
+  nativeBuildInputs = [ pkgconfig intltool automake autoconf libtool ];
+  buildInputs = [
+    json_c libsndfile gettext check database
 
-  buildInputs =
-    [ pkgconfig gnum4 libtool intltool glib dbus avahi libsamplerate libsndfile
-      speex json_c ]
-    ++ stdenv.lib.optional jackaudioSupport jack2
-    ++ stdenv.lib.optionals x11Support [ xlibs.xlibs xlibs.libXtst xlibs.libXi ]
-    ++ stdenv.lib.optional useSystemd systemd
-    ++ stdenv.lib.optionals stdenv.isLinux [ alsaLib bluez sbc udev ];
+    optLibcap valgrind optOss optCoreaudio optAlsaLib optEsound optGlib
+    optGtk3 optGconf optAvahi optLibjack2 optLibasyncns optLirc optDbus optUdev
+    optOpenssl optFftw optSpeexdsp optSystemd optWebrtc-audio-processing
+  ] ++ stdenv.lib.optionals hasXlibs (with xlibs; [
+      libX11 libxcb libICE libSM libXtst xextproto libXi
+    ]) ++ stdenv.lib.optionals (optBluez5 != null) [ optBluez5 optSbc ];
 
   preConfigure = ''
+    # Performs and autoreconf
+    export NOCONFIGURE="yes"
+    patchShebangs bootstrap.sh
+    ./bootstrap.sh
+
     # Move the udev rules under $(prefix).
     sed -i "src/Makefile.in" \
         -e "s|udevrulesdir[[:blank:]]*=.*$|udevrulesdir = $out/lib/udev/rules.d|g"
@@ -40,18 +105,54 @@ stdenv.mkDerivation rec {
   '';
 
   configureFlags = [
-    "--disable-solaris"
-    "--disable-jack"
-    "--disable-oss-output"
-  ] ++ stdenv.lib.optional (!ossWrapper) "--disable-oss-wrapper" ++
-  [
-    "--localstatedir=/var"
-    "--sysconfdir=/etc"
-    "--with-access-group=audio"
+    (mkOther                          "localstatedir"              "/var")
+    (mkOther                          "sysconfdir"                 "/etc")
+    (mkEnable false                   "atomic-arm-memory-barrier"  null)         # TODO: Enable on armv8
+    (mkEnable false                   "neon-opt"                   null)         # TODO: Enable on armv8
+    (mkEnable hasXlibs                "x11"                        null)
+    (mkWith   hasCaps                 "caps"                       optLibcap)
+    (mkEnable true                    "tests"                      null)
+    (mkEnable false                   "samplerate"                 null)         # Deprecated
+    (mkWith   true                    "database"                   databaseName)
+    (mkEnable hasOss                  "oss-output"                 null)
+    (mkEnable hasOss                  "oss-wrapper"                null)
+    (mkEnable (optCoreaudio != null)  "coreaudio-output"           null)
+    (mkEnable (optAlsaLib != null)    "alsa"                       null)
+    (mkEnable (optEsound != null)     "esound"                     null)
+    (mkEnable false                   "solaris"                    null)
+    (mkEnable false                   "waveout"                    null)         # Windows Only
+    (mkEnable (optGlib != null)       "glib2"                      null)
+    (mkEnable (optGtk3 != null)       "gtk3"                       null)
+    (mkEnable (optGconf != null)      "gconf"                      null)
+    (mkEnable (optAvahi != null)      "avahi"                      null)
+    (mkEnable (optLibjack2 != null)   "jack"                       null)
+    (mkEnable (optLibasyncns != null) "asyncns"                    null)
+    (mkEnable false                   "tcpwrap"                    null)
+    (mkEnable (optLirc != null)       "lirc"                       null)
+    (mkEnable (optDbus != null)       "dbus"                       null)
+    (mkEnable false                   "bluez4"                     null)
+    (mkEnable (optBluez5 != null)     "bluez5"                     null)
+    (mkEnable (optBluez5 != null)     "bluez5-ofono-headset"       null)
+    (mkEnable (optBluez5 != null)     "bluez5-native-headset"      null)
+    (mkEnable (optUdev != null)       "udev"                       null)
+    (mkEnable false                   "hal-compat"                 null)
+    (mkEnable true                    "ipv6"                       null)
+    (mkEnable (optOpenssl != null)    "openssl"                    null)
+    (mkWith   (optFftw != null)       "fftw"                       null)
+    (mkWith   (optSpeexdsp != null)   "speex"                      null)
+    (mkEnable false                   "xen"                        null)
+    (mkEnable false                   "gcov"                       null)
+    (mkEnable (optSystemd != null)    "systemd-daemon"             null)
+    (mkEnable (optSystemd != null)    "systemd-login"              null)
+    (mkEnable (optSystemd != null)    "systemd-journal"            null)
+    (mkEnable true                    "manpages"                   null)
+    (mkEnable hasWebrtc               "webrtc-aec"                 null)
+    (mkEnable true                    "adrian-aec"                 null)
+    (mkWith   true                    "system-user"                "pulseaudio")
+    (mkWith   true                    "system-group"               "pulseaudio")
+    (mkWith   true                    "access-group"               "audio")
     "--with-systemduserunitdir=\${out}/lib/systemd/user"
-  ]
-    ++ stdenv.lib.optional jackaudioSupport "--enable-jack"
-    ++ stdenv.lib.optional stdenv.isDarwin "--with-mac-sysroot=/";
+  ] ++ stdenv.lib.optional stdenv.isDarwin "--with-mac-sysroot=/";
 
   enableParallelBuilding = true;
 
@@ -63,7 +164,14 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin
     "-I/usr/include";
 
-  installFlags = "sysconfdir=$(out)/etc pulseconfdir=$(out)/etc/pulse";
+  installFlags = [
+    "sysconfdir=$(out)/etc"
+    "pulseconfdir=$(out)/etc/pulse"
+  ];
+
+  postInstall = stdenv.lib.optionalString libOnly ''
+    rm -rf $out/{bin,share,etc,lib/{pulse-*,systemd}}
+  '';
 
   meta = with stdenv.lib; {
     description = "Sound server for POSIX and Win32 systems";
@@ -71,7 +179,7 @@ stdenv.mkDerivation rec {
     # Note: Practically, the server is under the GPL due to the
     # dependency on `libsamplerate'.  See `LICENSE' for details.
     licenses    = licenses.lgpl2Plus;
-    maintainers = with maintainers; [ lovek323 ];
+    maintainers = with maintainers; [ lovek323 wkennington ];
     platforms   = platforms.unix;
 
     longDescription = ''
diff --git a/pkgs/servers/rippled/default.nix b/pkgs/servers/rippled/default.nix
index 39a7460674e..6a09d683f8d 100644
--- a/pkgs/servers/rippled/default.nix
+++ b/pkgs/servers/rippled/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "rippled-${version}";
-  version = "0.27.3-sp2";
+  version = "0.27.4";
 
   src = fetchFromGitHub {
     owner = "ripple";
     repo = "rippled";
     rev = version;
-    sha256 = "1q4i87cc7yks9slpgrfnlimngm45n3h035ssjvywmfwhhh7r9m3y";
+    sha256 = "13xg2baqcf2h1ww2yk371r27726iq8xb4brsj9rqv692aviblqs3";
   };
 
   postPatch = ''
@@ -29,6 +29,6 @@ stdenv.mkDerivation rec {
     homepage = https://ripple.com;
     maintainers = [ maintainers.emery maintainers.offline ];
     license = licenses.isc;
-    platforms = platforms.linux;
+    platforms = [ "x86_64-linux" ];
   };
 }
diff --git a/pkgs/servers/samba/4.x.nix b/pkgs/servers/samba/4.x.nix
index 79736e17a50..49b81794f04 100644
--- a/pkgs/servers/samba/4.x.nix
+++ b/pkgs/servers/samba/4.x.nix
@@ -13,7 +13,7 @@
 , acl ? null
 , libaio ? null
 , fam ? null
-, ceph ? null
+, libceph ? null
 , glusterfs ? null
 
 # buildtools/wafsamba/wscript optionals
@@ -50,11 +50,11 @@ let
   hasInfinibandOrNull = if libibverbs != null && librdmacm != null then true else null;
 in
 stdenv.mkDerivation rec {
-  name = "samba-4.2.0";
+  name = "samba-4.2.1";
 
   src = fetchurl {
     url = "mirror://samba/pub/samba/stable/${name}.tar.gz";
-    sha256 = "03s9pjdgq6nlv2lcnlmxlhhj8m5drgv6z4xy9zkgwwd92mw0b9k6";
+    sha256 = "1hsakc8h6rs48xr6i55m90pd53hpxcqjjnlwq8i2rp0nq4ws5sip";
   };
 
   patches = [
@@ -68,7 +68,7 @@ stdenv.mkDerivation rec {
     pythonPackages.subunit libbsd nss_wrapper socket_wrapper uid_wrapper
     libarchive
 
-    kerberos zlib openldap cups pam avahi acl libaio fam ceph glusterfs
+    kerberos zlib openldap cups pam avahi acl libaio fam libceph glusterfs
 
     libiconv gettext
 
@@ -114,7 +114,7 @@ stdenv.mkDerivation rec {
     (mkWith   (libarchive != null) "libarchive"        null)
     (mkWith   true                 "cluster-support"   null)
     (mkWith   (ncurses != null)    "regedit"           null)
-    (mkWith   ceph                 "libcephfs"         ceph)
+    (mkWith   libceph              "libcephfs"         libceph)
     (mkEnable (glusterfs != null)  "glusterfs"         null)
 
     # dynconfig/wscript options
diff --git a/pkgs/servers/search/elasticsearch/plugins.nix b/pkgs/servers/search/elasticsearch/plugins.nix
index 6a0693ef1f5..69941d5c46c 100644
--- a/pkgs/servers/search/elasticsearch/plugins.nix
+++ b/pkgs/servers/search/elasticsearch/plugins.nix
@@ -1,4 +1,4 @@
-{ pkgs,  stdenv, fetchurl, unzip, elasticsearch }:
+{ pkgs,  stdenv, fetchurl, fetchFromGitHub, unzip, elasticsearch }:
 
 with pkgs.lib;
 
@@ -89,6 +89,21 @@ in {
       maintainers = [ maintainers.edwtjo ];
       platforms = elasticsearch.meta.platforms;
     };
+  };
 
+  elasticsearch_kopf = esPlugin rec {
+    name = "elasticsearch-kopf-${version}";
+    pluginName = "elasticsearch-kopf";
+    version = "1.4.7";
+    src = fetchurl {
+      url = "https://github.com/lmenezes/elasticsearch-kopf/archive/v${version}.zip";
+      sha256 = "17r9mmfjnraswij1glmglljga4i4mfiraivxmai6giwmm2grwlz3";
+    };
+    meta = {
+      homepage = https://github.com/lmenezes/elasticsearch-kopf;
+      description = "Web administration tool for ElasticSearch";
+      license = licenses.mit;
+    };
   };
+
 }
diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix
index f6c9d73aa8a..e5740491675 100644
--- a/pkgs/servers/sql/mariadb/default.nix
+++ b/pkgs/servers/sql/mariadb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, ncurses, openssl, pcre, boost, judy, bison, libxml2
+{ stdenv, fetchurl, cmake, ncurses, zlib, openssl, pcre, boost, judy, bison, libxml2
 , libaio, libevent, groff, jemalloc, perl, fixDarwinDylibNames
 }:
 
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "04ckq67qgkghh7yzrbzwidk7wn7yjml15gzj2c5p1hs2k7lr9lww";
   };
 
-  buildInputs = [ cmake ncurses openssl pcre libxml2 boost judy bison libevent ]
+  buildInputs = [ cmake ncurses openssl zlib pcre libxml2 boost judy bison libevent ]
     ++ stdenv.lib.optionals stdenv.isLinux [ jemalloc libaio ]
     ++ stdenv.lib.optionals stdenv.isDarwin [ perl fixDarwinDylibNames ];
 
@@ -81,9 +81,10 @@ stdenv.mkDerivation rec {
       --replace basedir=\"\" basedir=\"$out\"
 
     # Remove superfluous files
-    rm -r $out/mysql-test $out/sql-bench $out/data
+    rm -r $out/mysql-test $out/sql-bench $out/data # Don't need testing data
     rm $out/share/man/man1/mysql-test-run.pl.1
-    rm $out/bin/rcmysql
+    rm $out/bin/rcmysql # Not needed with nixos units
+    rm $out/bin/mysqlbug # Encodes a path to gcc and not really useful
     find $out/bin -name \*test\* -exec rm {} \;
 
     # Separate libs and includes into their own derivation
@@ -91,6 +92,11 @@ stdenv.mkDerivation rec {
     mv $out/lib $lib
     mv $out/include $lib
 
+    # Fix the mysql_config
+    sed -i $out/bin/mysql_config \
+      -e 's,-lz,-L${zlib}/lib -lz,g' \
+      -e 's,-lssl,-L${openssl}/lib -lssl,g'
+
     # Add mysql_config to libs since configure scripts use it
     mkdir -p $lib/bin
     cp $out/bin/mysql_config $lib/bin
diff --git a/pkgs/servers/sql/pgpool/default.nix b/pkgs/servers/sql/pgpool/default.nix
index 137e536e5d8..775621e64b4 100644
--- a/pkgs/servers/sql/pgpool/default.nix
+++ b/pkgs/servers/sql/pgpool/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://pgpool.net/mediawiki/index.php;
-    description = "a middleware that works between postgresql servers and postgresql clients.";
+    description = "A middleware that works between postgresql servers and postgresql clients";
     license = licenses.free;
     platforms = platforms.linux;
     maintainers = with maintainers; [ wkennington ];
diff --git a/pkgs/servers/sslh/default.nix b/pkgs/servers/sslh/default.nix
index 3f9aa4470f9..0de4dfff153 100644
--- a/pkgs/servers/sslh/default.nix
+++ b/pkgs/servers/sslh/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "sslh-${version}";
-  version = "1.16";
+  version = "1.17";
 
   src = fetchurl {
     url = "https://github.com/yrutschle/sslh/archive/v${version}.tar.gz";
-    sha256 = "0xwi2bflvq4phrqjic84xch20jkg3wdys219mw2cy23sjkzk63mb";
+    sha256 = "1l8ssm47f0hwiisgfj0ca5j2z8j98pir4pf2acrj1798fnzw6mxm";
   };
 
   postPatch = "patchShebangs *.sh";
diff --git a/pkgs/servers/varnish/default.nix b/pkgs/servers/varnish/default.nix
index 5b191bef872..358afb3dfb3 100644
--- a/pkgs/servers/varnish/default.nix
+++ b/pkgs/servers/varnish/default.nix
@@ -1,15 +1,17 @@
-{ stdenv, fetchurl, pcre, libxslt, groff, ncurses, pkgconfig, readline, python }:
+{ stdenv, fetchurl, pcre, libxslt, groff, ncurses, pkgconfig, readline, python
+, pythonPackages }:
 
 stdenv.mkDerivation rec {
-  version = "3.0.6";
+  version = "4.0.3";
   name = "varnish-${version}";
 
   src = fetchurl {
     url = "http://repo.varnish-cache.org/source/${name}.tar.gz";
-    sha256 = "1dw0nrplx5pa09z8vbjpncniv3qib5bh3qp3yqbk2d774n7ys3c4";
+    sha256 = "01l2iypajkdanxpbvzfxm6vs4jay4dgw7lmchqidnivz15sa3fcl";
   };
 
-  buildInputs = [ pcre libxslt groff ncurses pkgconfig readline python ];
+  buildInputs = [ pcre libxslt groff ncurses pkgconfig readline python
+    pythonPackages.docutils];
 
   meta = {
     description = "Web application accelerator also known as a caching HTTP reverse proxy";
diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix
index 27fed661d75..b7823129043 100644
--- a/pkgs/servers/x11/xorg/overrides.nix
+++ b/pkgs/servers/x11/xorg/overrides.nix
@@ -1,7 +1,7 @@
 { args, xorg }:
 
 let
-  inherit (args) stdenv;
+  inherit (args) stdenv makeWrapper;
   inherit (stdenv) lib isDarwin;
   inherit (lib) overrideDerivation;
 
@@ -346,13 +346,14 @@ in
     in
       if (!isDarwin)
       then {
-        buildInputs = commonBuildInputs;
+        buildInputs = [ makeWrapper ] ++ commonBuildInputs;
         propagatedBuildInputs = commonPropagatedBuildInputs ++ lib.optionals stdenv.isLinux [
           args.udev
         ];
         patches = commonPatches;
         configureFlags = [
           "--enable-kdrive"             # not built by default
+          "--enable-xephyr"
           "--enable-xcsecurity"         # enable SECURITY extension
           "--with-default-font-path="   # there were only paths containing "${prefix}",
                                         # and there are no fonts in this package anyway
@@ -360,6 +361,9 @@ in
         postInstall = ''
           rm -fr $out/share/X11/xkb/compiled
           ln -s /var/tmp $out/share/X11/xkb/compiled
+          wrapProgram $out/bin/Xephyr \
+            --set XKB_BINDIR "${xorg.xkbcomp}/bin" \
+            --add-flags "-xkbdir ${xorg.xkeyboardconfig}/share/X11/xkb"
         '';
         passthru.version = version; # needed by virtualbox guest additions
       } else {
diff --git a/pkgs/servers/x11/xorg/xorgserver-xkbcomp-path.patch b/pkgs/servers/x11/xorg/xorgserver-xkbcomp-path.patch
index f5196c60c7c..a0951269b42 100644
--- a/pkgs/servers/x11/xorg/xorgserver-xkbcomp-path.patch
+++ b/pkgs/servers/x11/xorg/xorgserver-xkbcomp-path.patch
@@ -1,15 +1,15 @@
-diff -rc xorg-server-X11R7.2-1.2.0-orig/xkb/xkbInit.c xorg-server-X11R7.2-1.2.0/xkb/xkbInit.c
-*** xorg-server-X11R7.2-1.2.0-orig/xkb/xkbInit.c	Tue Jan 23 04:13:16 2007
---- xorg-server-X11R7.2-1.2.0/xkb/xkbInit.c	Fri Mar 30 00:52:53 2007
+*** xorg-server-X11R7.2-1.2.0-orig/xkb/xkbInit.c	2015-02-11 00:32:06.000000000 +0100
+--- xorg-server-X11R7.2-1.2.0/xkb/xkbInit.c	2015-04-11 10:10:41.948438435 +0200
 ***************
-*** 923,928 ****
---- 923,931 ----
-  	XkbDfltRepeatInterval = (long)atoi(argv[i]);
-  	return 2;
-      }
+*** 733,738 ****
+--- 733,742 ----
+  int
+  XkbProcessArguments(int argc, char *argv[], int i)
+  {
 +     char *xkbBinDir = getenv("XKB_BINDIR");
 +     if (xkbBinDir)
 +         XkbBinDirectory = Xstrdup(xkbBinDir);
-      return 0;
-  }
-  
++ 
+      if (strncmp(argv[i], "-xkbdir", 7) == 0) {
+          if (++i < argc) {
+  #if !defined(WIN32) && !defined(__CYGWIN__)