summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/functions.xml57
-rw-r--r--doc/manual.xml1
-rw-r--r--lib/maintainers.nix2
-rw-r--r--nixos/modules/config/system-path.nix2
-rw-r--r--nixos/modules/services/continuous-integration/jenkins/default.nix2
-rw-r--r--nixos/modules/services/mail/mlmmj.nix1
-rw-r--r--nixos/modules/services/mail/postfix.nix10
-rw-r--r--nixos/modules/services/misc/gitolite.nix2
-rw-r--r--nixos/modules/services/misc/nix-daemon.nix36
-rw-r--r--nixos/modules/services/web-servers/apache-httpd/wordpress.nix120
-rw-r--r--nixos/modules/services/x11/window-managers/stumpwm.nix7
-rw-r--r--nixos/modules/virtualisation/ec2-data.nix2
-rw-r--r--nixos/modules/virtualisation/nova.nix2
-rw-r--r--pkgs/applications/misc/qtpass/default.nix35
-rw-r--r--pkgs/applications/networking/browsers/firefox-bin/default.nix4
-rw-r--r--pkgs/applications/office/zotero/firefox-bin/default.nix4
-rw-r--r--pkgs/applications/science/logic/acgtk/default.nix9
-rw-r--r--pkgs/applications/science/logic/coq/8.3.nix4
-rw-r--r--pkgs/applications/science/logic/eprover/default.nix10
-rw-r--r--pkgs/applications/science/math/glsurf/default.nix6
-rw-r--r--pkgs/applications/version-management/codeville/0.8.0.nix23
-rw-r--r--pkgs/applications/video/k9copy/default.nix8
-rw-r--r--pkgs/applications/video/obs-studio/default.nix10
-rw-r--r--pkgs/applications/window-managers/stumpwm/default.nix2
-rw-r--r--pkgs/desktops/gnome-3/3.16/core/gnome-control-center/default.nix4
-rw-r--r--pkgs/desktops/gnome-3/3.16/default.nix1
-rw-r--r--pkgs/development/compilers/hhvm/default.nix4
-rw-r--r--pkgs/development/compilers/ocaml/4.02.1.nix6
-rw-r--r--pkgs/development/interpreters/erlang/R18.nix87
-rw-r--r--pkgs/development/libraries/libtsm/darwin.patch37
-rw-r--r--pkgs/development/libraries/libtsm/default.nix18
-rw-r--r--pkgs/development/libraries/ti-rpc/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/bolt/default.nix17
-rw-r--r--pkgs/development/ocaml-modules/eliom/camlp4.patch24
-rw-r--r--pkgs/development/ocaml-modules/eliom/default.nix2
-rw-r--r--pkgs/development/ocaml-modules/lablgtk/2.14.0.nix4
-rw-r--r--pkgs/development/ocaml-modules/mysql/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/ulex/default.nix5
-rw-r--r--pkgs/development/tools/misc/autobuild/default.nix4
-rw-r--r--pkgs/development/tools/ocaml/js_of_ocaml/default.nix4
-rw-r--r--pkgs/misc/vim-plugins/default.nix93
-rw-r--r--pkgs/os-specific/linux/kernel/common-config.nix2
-rw-r--r--pkgs/servers/nosql/cassandra/2.0.nix4
-rw-r--r--pkgs/servers/nosql/cassandra/2.1.nix4
-rw-r--r--pkgs/servers/vault/default.nix48
-rw-r--r--pkgs/tools/misc/file/default.nix5
-rw-r--r--pkgs/tools/misc/stow/default.nix2
-rw-r--r--pkgs/tools/misc/stow/precedence-issue.patch15
-rw-r--r--pkgs/tools/system/rsyslog/default.nix6
-rw-r--r--pkgs/tools/typesetting/tex/texlive/default.nix4
-rw-r--r--pkgs/top-level/all-packages.nix77
-rw-r--r--pkgs/top-level/python-packages.nix28
-rw-r--r--pkgs/top-level/release-lib.nix1
53 files changed, 673 insertions, 200 deletions
diff --git a/doc/functions.xml b/doc/functions.xml
new file mode 100644
index 00000000000..16f4f262a25
--- /dev/null
+++ b/doc/functions.xml
@@ -0,0 +1,57 @@
+<chapter xmlns="http://docbook.org/ns/docbook"
+	 xmlns:xlink="http://www.w3.org/1999/xlink"
+	 xml:id="chap-functions">
+
+<title>Functions reference</title>
+
+<para>
+  The nixpkgs repository has several utility functions to manipulate Nix expressions.
+</para>
+
+<section xml:id="sec-pkgs-overridePackages">
+  <title>pkgs.overridePackages</title>
+
+  <para>
+    This function inside the nixpkgs expression (<varname>pkgs</varname>)
+    can be used to override the set of packages itself.
+  </para>
+  <para>
+    Warning: this function is expensive and must not be used from within
+    the nixpkgs repository.
+  </para>
+  <para>
+    Example usage:
+
+    <programlisting>let
+  pkgs = import &lt;nixpkgs&gt; {};
+  newpkgs = pkgs.overridePackages (self: super: {
+    foo = super.foo.override { ... };
+  };
+in ...</programlisting>
+  </para>
+
+  <para>
+    The resulting <varname>newpkgs</varname> will have the new <varname>foo</varname>
+    expression, and all other expressions depending on <varname>foo</varname> will also
+    use the new <varname>foo</varname> expression.
+  </para>
+
+  <para>
+    The behavior of this function is similar to <link 
+    linkend="sec-modify-via-packageOverrides">config.packageOverrides</link>.
+  </para>
+
+  <para>
+    The <varname>self</varname> parameter refers to the final package set with the
+    applied overrides. Using this parameter may lead to infinite recursion if not
+    used consciously.
+  </para>
+
+  <para>
+    The <varname>super</varname> parameter refers to the old package set.
+    It's equivalent to <varname>pkgs</varname> in the above example.
+  </para>
+
+</section>
+
+</chapter>
diff --git a/doc/manual.xml b/doc/manual.xml
index a6400c98d6e..11f37184e6d 100644
--- a/doc/manual.xml
+++ b/doc/manual.xml
@@ -13,6 +13,7 @@
   <xi:include href="quick-start.xml" />
   <xi:include href="stdenv.xml" />
   <xi:include href="packageconfig.xml" />
+  <xi:include href="functions.xml" />
   <xi:include href="meta.xml" />
   <xi:include href="language-support.xml" />
   <xi:include href="package-notes.xml" />
diff --git a/lib/maintainers.nix b/lib/maintainers.nix
index eb5dcbf4313..5077ac233f2 100644
--- a/lib/maintainers.nix
+++ b/lib/maintainers.nix
@@ -31,6 +31,7 @@
   astsmtl = "Alexander Tsamutali <astsmtl@yandex.ru>";
   aszlig = "aszlig <aszlig@redmoonstudios.org>";
   auntie = "Jonathan Glines <auntieNeo@gmail.com>";
+  avnik = "Alexander V. Nikolaev <avn@avnik.info>";
   aycanirican = "Aycan iRiCAN <iricanaycan@gmail.com>";
   balajisivaraman = "Balaji Sivaraman<sivaraman.balaji@gmail.com>";
   bbenoist = "Baptist BENOIST <return_0@live.com>";
@@ -60,6 +61,7 @@
   codyopel = "Cody Opel <codyopel@gmail.com>";
   copumpkin = "Dan Peebles <pumpkingod@gmail.com>";
   coroa = "Jonas Hörsch <jonas@chaoflow.net>";
+  couchemar = "Andrey Pavlov <couchemar@yandex.ru>";
   cstrahan = "Charles Strahan <charles.c.strahan@gmail.com>";
   cwoac = "Oliver Matthews <oliver@codersoffortune.net>";
   DamienCassou = "Damien Cassou <damien.cassou@gmail.com>";
diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix
index d22f9ebd1df..62390f452ba 100644
--- a/nixos/modules/config/system-path.nix
+++ b/nixos/modules/config/system-path.nix
@@ -38,7 +38,7 @@ let
       pkgs.nano
       pkgs.ncurses
       pkgs.netcat
-      pkgs.openssh
+      config.programs.ssh.package
       pkgs.perl
       pkgs.procps
       pkgs.rsync
diff --git a/nixos/modules/services/continuous-integration/jenkins/default.nix b/nixos/modules/services/continuous-integration/jenkins/default.nix
index ccea85faa3e..95d2aecfac7 100644
--- a/nixos/modules/services/continuous-integration/jenkins/default.nix
+++ b/nixos/modules/services/continuous-integration/jenkins/default.nix
@@ -57,7 +57,7 @@ in {
       };
 
       packages = mkOption {
-        default = [ pkgs.stdenv pkgs.git pkgs.jdk pkgs.openssh pkgs.nix ];
+        default = [ pkgs.stdenv pkgs.git pkgs.jdk config.programs.ssh.package pkgs.nix ];
         type = types.listOf types.package;
         description = ''
           Packages to add to PATH for the jenkins process.
diff --git a/nixos/modules/services/mail/mlmmj.nix b/nixos/modules/services/mail/mlmmj.nix
index 1545c60f4de..db3a266d011 100644
--- a/nixos/modules/services/mail/mlmmj.nix
+++ b/nixos/modules/services/mail/mlmmj.nix
@@ -88,6 +88,7 @@ in
 
     services.postfix = {
       enable = true;
+      recipientDelimiter= "+";
       extraMasterConf = ''
         mlmmj unix - n n - - pipe flags=ORhu user=mlmmj argv=${pkgs.mlmmj}/bin/mlmmj-receive -F -L ${spoolDir}/$nextHop
       '';
diff --git a/nixos/modules/services/mail/postfix.nix b/nixos/modules/services/mail/postfix.nix
index 3d9bb9ccf24..29e0cf7a882 100644
--- a/nixos/modules/services/mail/postfix.nix
+++ b/nixos/modules/services/mail/postfix.nix
@@ -77,6 +77,8 @@ let
       smtpd_tls_key_file = ${cfg.sslKey}
 
       smtpd_use_tls = yes
+
+      recipient_delimiter = ${cfg.recipientDelimiter}
     ''
     + optionalString (cfg.virtual != "") ''
       virtual_alias_maps = hash:/etc/postfix/virtual
@@ -289,6 +291,14 @@ in
         description = "SSL key to use.";
       };
 
+      recipientDelimiter = mkOption {
+        default = "";
+        example = "+";
+        description = "
+          Delimiter for address extension: so mail to user+test can be handled by ~user/.forward+test
+        ";
+      };
+
       virtual = mkOption {
         default = "";
         description = "
diff --git a/nixos/modules/services/misc/gitolite.nix b/nixos/modules/services/misc/gitolite.nix
index 16335c8aca7..5012bed0c42 100644
--- a/nixos/modules/services/misc/gitolite.nix
+++ b/nixos/modules/services/misc/gitolite.nix
@@ -75,7 +75,7 @@ in
       serviceConfig.Type = "oneshot";
       serviceConfig.RemainAfterExit = true;
 
-      path = [ pkgs.gitolite pkgs.git pkgs.perl pkgs.bash pkgs.openssh ];
+      path = [ pkgs.gitolite pkgs.git pkgs.perl pkgs.bash config.programs.ssh.package ];
       script = ''
         cd ${cfg.dataDir}
         mkdir -p .gitolite/logs
diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix
index 6d25fef4576..e5948e223d5 100644
--- a/nixos/modules/services/misc/nix-daemon.nix
+++ b/nixos/modules/services/misc/nix-daemon.nix
@@ -47,6 +47,8 @@ let
         ${optionalString cfg.requireSignedBinaryCaches ''
           signed-binary-caches = *
         ''}
+        trusted-users = ${toString cfg.trustedUsers}
+        allowed-users = ${toString cfg.allowedUsers}
         $extraOptions
         END
       '';
@@ -277,6 +279,36 @@ in
         '';
       };
 
+      trustedUsers = mkOption {
+        type = types.listOf types.str;
+        default = [ "root" ];
+        example = [ "root" "alice" "@wheel" ];
+        description = ''
+          A list of names of users that have additional rights when
+          connecting to the Nix daemon, such as the ability to specify
+          additional binary caches, or to import unsigned NARs. You
+          can also specify groups by prefixing them with
+          <literal>@</literal>; for instance,
+          <literal>@wheel</literal> means all users in the wheel
+          group.
+        '';
+      };
+
+      allowedUsers = mkOption {
+        type = types.listOf types.str;
+        default = [ "*" ];
+        example = [ "@wheel" "@builders" "alice" "bob" ];
+        description = ''
+          A list of names of users (separated by whitespace) that are
+          allowed to connect to the Nix daemon. As with
+          <option>nix.trustedUsers</option>, you can specify groups by
+          prefixing them with <literal>@</literal>. Also, you can
+          allow all users by specifying <literal>*</literal>. The
+          default is <literal>*</literal>. Note that trusted users are
+          always allowed to connect.
+        '';
+      };
+
     };
 
   };
@@ -296,7 +328,7 @@ in
       { enable = cfg.buildMachines != [];
         text =
           concatMapStrings (machine:
-            "${machine.sshUser}@${machine.hostName} "
+            "${if machine ? sshUser then "${machine.sshUser}@" else ""}${machine.hostName} "
             + (if machine ? system then machine.system else concatStringsSep "," machine.systems)
             + " ${machine.sshKey} ${toString machine.maxJobs} "
             + (if machine ? speedFactor then toString machine.speedFactor else "1" )
@@ -313,7 +345,7 @@ in
     systemd.sockets.nix-daemon.wantedBy = [ "sockets.target" ];
 
     systemd.services.nix-daemon =
-      { path = [ nix pkgs.openssl pkgs.utillinux pkgs.openssh ]
+      { path = [ nix pkgs.openssl pkgs.utillinux config.programs.ssh.package ]
           ++ optionals cfg.distributedBuilds [ pkgs.gzip ];
 
         environment = cfg.envVars
diff --git a/nixos/modules/services/web-servers/apache-httpd/wordpress.nix b/nixos/modules/services/web-servers/apache-httpd/wordpress.nix
index 01b6cfc62af..df099754b54 100644
--- a/nixos/modules/services/web-servers/apache-httpd/wordpress.nix
+++ b/nixos/modules/services/web-servers/apache-httpd/wordpress.nix
@@ -1,22 +1,12 @@
 { config, lib, pkgs, serverInfo, php, ... }:
+# http://codex.wordpress.org/Hardening_WordPress
 
 with lib;
 
 let
-  # https://wordpress.org/plugins/postgresql-for-wordpress/
-  # Wordpress plugin 'postgresql-for-wordpress' installation example
-  postgresqlForWordpressPlugin = pkgs.stdenv.mkDerivation {
-    name = "postgresql-for-wordpress-plugin";
-    # Download the theme from the wordpress site
-    src = pkgs.fetchurl {
-      url = https://downloads.wordpress.org/plugin/postgresql-for-wordpress.1.3.1.zip;
-      sha256 = "f11a5d76af884c7bec2bc653ed5bd29d3ede9a8657bd67ab7824e329e5d809e8";
-    };
-    # We need unzip to build this package
-    buildInputs = [ pkgs.unzip ];
-    # Installing simply means copying all files to the output directory
-    installPhase = "mkdir -p $out; cp -R * $out/";
-  };
+
+  version = "4.2";
+  fullversion = "${version}.2";
 
   # Our bare-bones wp-config.php file using the above settings
   wordpressConfig = pkgs.writeText "wp-config.php" ''
@@ -38,38 +28,88 @@ let
     <IfModule mod_rewrite.c>
     RewriteEngine On
     RewriteBase /
-    RewriteCond %{REQUEST_FILENAME} !-f
-    RewriteCond %{REQUEST_FILENAME} !-d
-    RewriteRule . /index.php [L]
+    RewriteRule ^index\.php$ - [L]
+
+    # add a trailing slash to /wp-admin
+    RewriteRule ^wp-admin$ wp-admin/ [R=301,L]
+
+    RewriteCond %{REQUEST_FILENAME} -f [OR]
+    RewriteCond %{REQUEST_FILENAME} -d
+    RewriteRule ^ - [L]
+    RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
+    RewriteRule ^(.*\.php)$ $1 [L]
+    RewriteRule . index.php [L]
     </IfModule>
   '';
 
+  # WP translation can be found here:
+  #   https://make.wordpress.org/polyglots/teams/
+  # FIXME: 
+  #  - add all these languages: 
+  #    sq ar az eu bs bg ca zh-cn zh-tw hr da nl en-au 
+  #    en-ca en-gb eo fi fr gl de el he hu is id it ja 
+  #    ko lt nb nn oci pl pt-br pt ro ru sr sk es-mx es 
+  #    sv th tr uk cy
+  #  - cache the files on github.com/qknight/WordpressLanguages and use fetchFromGithub instead
+  #    note: this implementation of supportedLanguages will only work for me (qknight) as i'm using nix-prefetch-url
+  #          as the sha256 changes like every download. 
+  # note: this is also true for plugins and themes but these are controlled not from withing wordpress.nix
+  supportedLanguages = {
+    en_GB = "1yf1sb6ji3l4lg8nkkjhckbwl81jly8z93jf06pvk6a1p6bsr6l6";
+    de_DE = "3881221f337799b88f9562df8b3f1560f2c49a8f662297561a5b25ce77f22e17";
+  };
+
+  downloadLanguagePack = language: sha256:
+    pkgs.stdenv.mkDerivation rec {
+      name = "wp_${language}-${version}";
+      src = pkgs.fetchurl {
+        url = "https://downloads.wordpress.org/translation/core/${version}/${language}.zip";
+        sha256 = "${sha256}";
+      };
+      buildInputs = [ pkgs.unzip ];
+      unpackPhase = ''
+        unzip $src
+        export sourceRoot=.
+      '';
+      installPhase = "mkdir -p $out; cp -R * $out/";
+    };
+
+  selectedLanguages = map (lang: downloadLanguagePack lang supportedLanguages.${lang}) (config.languages);
+
   # The wordpress package itself
   wordpressRoot = pkgs.stdenv.mkDerivation rec {
     name = "wordpress";
-    # Fetch directly from the wordpress site, want to upgrade?
-    # Just change the version URL and update the hash
-    src = pkgs.fetchurl {
-      url = http://wordpress.org/wordpress-4.1.1.tar.gz;
-      sha256 = "1s9y0i9ms3m6dswb9gqrr95plnx6imahc07fyhvrp5g35f6c12k1";
+    src = pkgs.fetchFromGitHub {
+      owner = "WordPress";
+      repo = "WordPress";
+      rev = "${fullversion}";
+      sha256 = "0gq1j9b0d0rykql3jzdb2yn4adj0rrcsvqrmj3dzx11ir57ilsgc";
     };
     installPhase = ''
       mkdir -p $out
-      # Copy all the wordpress files we downloaded
+      # copy all the wordpress files we downloaded
       cp -R * $out/
-      # We'll symlink the wordpress config
+
+      # symlink the wordpress config
       ln -s ${wordpressConfig} $out/wp-config.php
-      # As well as our custom .htaccess
+      # symlink custom .htaccess
       ln -s ${htaccess} $out/.htaccess
-      # And the uploads directory
+      # symlink uploads directory
       ln -s ${config.wordpressUploads} $out/wp-content/uploads
-      # And the theme(s)
+
+      # remove bundled plugins(s) coming with wordpress
+      rm -Rf $out/wp-content/plugins/*
+      # remove bundled themes(s) coming with wordpress
+      rm -Rf $out/wp-content/themes/*
+
+      # symlink additional theme(s)
       ${concatMapStrings (theme: "ln -s ${theme} $out/wp-content/themes/${theme.name}\n") config.themes}
-      # And the plugin(s)
-      # remove bundled plugin(s) coming with wordpress
-      rm -Rf $out/wp-content/plugins/akismet
-      # install plugins
-      ${concatMapStrings (plugin: "ln -s ${plugin} $out/wp-content/plugins/${plugin.name}\n") (config.plugins ++ [ postgresqlForWordpressPlugin]) }
+      # symlink additional plugin(s)
+      ${concatMapStrings (plugin: "ln -s ${plugin} $out/wp-content/plugins/${plugin.name}\n") (config.plugins) }
+
+      # symlink additional translation(s) 
+      mkdir -p $out/wp-content/languages
+      ${concatMapStrings (language: "ln -s ${language}/*.mo ${language}/*.po $out/wp-content/languages/\n") (selectedLanguages) }
     '';
   };
 
@@ -102,12 +142,12 @@ in
     };
     dbUser = mkOption {
       default = "wordpress";
-      description = "The dbUser, read the username, for the database.";
+      description = "The dbUser, read: the username, for the database.";
       example = "wordpress";
     };
     dbPassword = mkOption {
       default = "wordpress";
-      description = "The password to the respective dbUser.";
+      description = "The mysql password to the respective dbUser.";
       example = "wordpress";
     };
     tablePrefix = mkOption {
@@ -127,7 +167,7 @@ in
       type = types.listOf types.path;
       description =
         ''
-          List of path(s) to respective plugin(s) which are symlinked from the 'plugins' directory. Note: These plugins need to be packaged before use.
+          List of path(s) to respective plugin(s) which are symlinked from the 'plugins' directory. Note: These plugins need to be packaged before use, see example.
         '';
       example = ''
         # Wordpress plugin 'akismet' installation example
@@ -153,7 +193,7 @@ in
       type = types.listOf types.path;
       description =
         ''
-          List of path(s) to respective theme(s) which are symlinked from the 'theme' directory. Note: These themes need to be packaged before use.
+          List of path(s) to respective theme(s) which are symlinked from the 'theme' directory. Note: These themes need to be packaged before use, see example.
         '';
       example = ''
         # For shits and giggles, let's package the responsive theme
@@ -174,6 +214,11 @@ in
           themes = [ responsiveTheme ];
       '';
     };
+    languages = mkOption {
+          default = [];
+          description = "Installs wordpress language packs based on the list, see wordpress.nix for possible translations.";
+          example = "[ \"en_GB\" \"de_DE\" ];";
+    };
     extraConfig = mkOption {
       default = "";
       example =
@@ -198,12 +243,15 @@ in
     # we should use systemd dependencies here
     #waitForUnit("network-interfaces.target");
     if [ ! -d ${serverInfo.fullConfig.services.mysql.dataDir}/${config.dbName} ]; then
+      echo "Need to create the database '${config.dbName}' and grant permissions to user named '${config.dbUser}'."
       # Wait until MySQL is up
       while [ ! -e /var/run/mysql/mysqld.pid ]; do
         sleep 1
       done
       ${pkgs.mysql}/bin/mysql -e 'CREATE DATABASE ${config.dbName};'
       ${pkgs.mysql}/bin/mysql -e 'GRANT ALL ON ${config.dbName}.* TO ${config.dbUser}@localhost IDENTIFIED BY "${config.dbPassword}";'
+    else 
+      echo "Good, no need to do anything database related."
     fi
   '';
 }
diff --git a/nixos/modules/services/x11/window-managers/stumpwm.nix b/nixos/modules/services/x11/window-managers/stumpwm.nix
index a876f13fd21..eb7b8665f23 100644
--- a/nixos/modules/services/x11/window-managers/stumpwm.nix
+++ b/nixos/modules/services/x11/window-managers/stumpwm.nix
@@ -21,9 +21,10 @@ in
   config = mkIf cfg.enable {
     services.xserver.windowManager.session = singleton {
       name = "stumpwm";
-      start = "
-        ${pkgs.stumpwm}/bin/stumpwm
-      ";
+      start = ''
+        ${pkgs.stumpwm}/bin/stumpwm &
+        waitPID=$!
+      '';
     };
     environment.systemPackages = [ pkgs.stumpwm ];
   };
diff --git a/nixos/modules/virtualisation/ec2-data.nix b/nixos/modules/virtualisation/ec2-data.nix
index fd062237bb0..0b2479c1046 100644
--- a/nixos/modules/virtualisation/ec2-data.nix
+++ b/nixos/modules/virtualisation/ec2-data.nix
@@ -91,7 +91,7 @@ with lib;
             # can obtain it securely by parsing the output of
             # ec2-get-console-output.
             echo "-----BEGIN SSH HOST KEY FINGERPRINTS-----" > /dev/console
-            ${pkgs.openssh}/bin/ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub > /dev/console
+            ${config.programs.ssh.package}/bin/ssh-keygen -l -f /etc/ssh/ssh_host_dsa_key.pub > /dev/console
             echo "-----END SSH HOST KEY FINGERPRINTS-----" > /dev/console
           '';
         serviceConfig.Type = "oneshot";
diff --git a/nixos/modules/virtualisation/nova.nix b/nixos/modules/virtualisation/nova.nix
index 21e060cf266..f356445abe4 100644
--- a/nixos/modules/virtualisation/nova.nix
+++ b/nixos/modules/virtualisation/nova.nix
@@ -100,7 +100,7 @@ in
 
         # `openssl' is required to generate the CA.  `openssh' is
         # required to generate key pairs.
-        path = [ pkgs.openssl pkgs.openssh pkgs.bash ];
+        path = [ pkgs.openssl config.programs.ssh.package pkgs.bash ];
 
         respawn = false;
 
diff --git a/pkgs/applications/misc/qtpass/default.nix b/pkgs/applications/misc/qtpass/default.nix
new file mode 100644
index 00000000000..828019011fc
--- /dev/null
+++ b/pkgs/applications/misc/qtpass/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, git, gnupg, makeWrapper, pass, qt5 }:
+
+stdenv.mkDerivation rec {
+  name = "qtpass-${version}";
+  version = "0.8.4";
+
+  src = fetchurl {
+    url = "https://github.com/IJHack/qtpass/archive/v${version}.tar.gz";
+    sha256 = "14avh04q559p64ska1w814pbwv0742aaqln036pw99fjxav685g0";
+  };
+
+  buildInputs = [ git gnupg makeWrapper pass qt5.base ];
+
+  configurePhase = "qmake CONFIG+=release PREFIX=$out DESTDIR=$out";
+
+  installPhase = ''
+    mkdir $out/bin
+    mv $out/qtpass $out/bin
+  '';
+
+  postInstall = ''
+    wrapProgram $out/bin/qtpass \
+        --suffix PATH : ${git}/bin \
+        --suffix PATH : ${gnupg}/bin \
+        --suffix PATH : ${pass}/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A multi-platform GUI for pass, the standard unix password manager";
+    homepage = https://github.com/IJHack/qtpass;
+    license = licenses.gpl3;
+    maintainers = [ maintainers.hrdinka ];
+    platforms = platforms.all;
+  };
+}
diff --git a/pkgs/applications/networking/browsers/firefox-bin/default.nix b/pkgs/applications/networking/browsers/firefox-bin/default.nix
index 62afcc2583a..ebc05a79af9 100644
--- a/pkgs/applications/networking/browsers/firefox-bin/default.nix
+++ b/pkgs/applications/networking/browsers/firefox-bin/default.nix
@@ -30,7 +30,7 @@
 , nspr
 , nss
 , pango
-, heimdal
+, libheimdal
 , libpulseaudio
 , systemd
 }:
@@ -102,7 +102,7 @@ stdenv.mkDerivation {
       nspr
       nss
       pango
-      heimdal
+      libheimdal
       libpulseaudio
       systemd
     ] + ":" + stdenv.lib.makeSearchPath "lib64" [
diff --git a/pkgs/applications/office/zotero/firefox-bin/default.nix b/pkgs/applications/office/zotero/firefox-bin/default.nix
index 52751908fa7..edf56c3eb4d 100644
--- a/pkgs/applications/office/zotero/firefox-bin/default.nix
+++ b/pkgs/applications/office/zotero/firefox-bin/default.nix
@@ -30,7 +30,7 @@
 , nspr
 , nss
 , pango
-, heimdal
+, libheimdal
 , libpulseaudio
 , systemd
 }:
@@ -102,7 +102,7 @@ stdenv.mkDerivation {
       nspr
       nss
       pango
-      heimdal
+      libheimdal
       libpulseaudio
       systemd
     ] + ":" + stdenv.lib.makeSearchPath "lib64" [
diff --git a/pkgs/applications/science/logic/acgtk/default.nix b/pkgs/applications/science/logic/acgtk/default.nix
index 41c6cf75f32..0fd90ac13b6 100644
--- a/pkgs/applications/science/logic/acgtk/default.nix
+++ b/pkgs/applications/science/logic/acgtk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, findlib, dypgen, bolt, ansiterminal,
+{ stdenv, fetchurl, ocaml, findlib, dypgen, bolt, ansiterminal, camlp4,
   buildBytecode ? true,
   buildNative ? true,
   installExamples ? true,
@@ -22,11 +22,16 @@ stdenv.mkDerivation {
     sha256 = "1k1ldqg34bwmgdpmi9gry9czlsk85ycjxnkd25fhlf3mmgg4n9p6";
   };
 
-  buildInputs = [ ocaml findlib dypgen bolt ansiterminal ];
+  buildInputs = [ ocaml findlib dypgen bolt ansiterminal camlp4 ];
 
   patches = [ ./install-emacs-to-site-lisp.patch
               ./use-nix-ocaml-byteflags.patch ];
 
+  postPatch = stdenv.lib.optionalString (camlp4 != null) ''
+    substituteInPlace src/Makefile.master.in \
+      --replace "+camlp4" "${camlp4}/lib/ocaml/${getVersion ocaml}/site-lib/camlp4/"
+  '';
+
   # The bytecode executable is dependent on the dynamic library provided by
   # ANSITerminal. We can use the -dllpath flag of ocamlc (analogous to
   # -rpath) to make sure that ocamlrun is able to link the library at
diff --git a/pkgs/applications/science/logic/coq/8.3.nix b/pkgs/applications/science/logic/coq/8.3.nix
index 63aaa02e67a..c59c4b06270 100644
--- a/pkgs/applications/science/logic/coq/8.3.nix
+++ b/pkgs/applications/science/logic/coq/8.3.nix
@@ -1,6 +1,6 @@
 # - coqide compilation can be disabled by setting lablgtk to null;
 
-{stdenv, fetchurl, ocaml, findlib, camlp5, ncurses, lablgtk ? null}:
+{ stdenv, make, fetchurl, ocaml, findlib, camlp5, ncurses, lablgtk ? null }:
 
 let 
   version = "8.3pl4";
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
     sha256 = "17d3lmchmqir1rawnr52g78srg4wkd7clzpzfsivxc4y1zp6rwkr";
   };
 
-  buildInputs = [ ocaml findlib camlp5 ncurses lablgtk ];
+  buildInputs = [ make ocaml findlib camlp5 ncurses lablgtk ];
 
   prefixKey = "-prefix ";
 
diff --git a/pkgs/applications/science/logic/eprover/default.nix b/pkgs/applications/science/logic/eprover/default.nix
index 35e70a4b0d7..bb0e34d45bc 100644
--- a/pkgs/applications/science/logic/eprover/default.nix
+++ b/pkgs/applications/science/logic/eprover/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, which, texLive }:
+{ stdenv, fetchurl, which }:
 let
   s = # Generated upstream information
   rec {
@@ -18,26 +18,22 @@ stdenv.mkDerivation {
     inherit (s) url sha256;
   };
 
-  buildInputs = [which texLive];
+  buildInputs = [ which ];
 
   preConfigure = "sed -e 's@^EXECPATH\\s.*@EXECPATH = '\$out'/bin@' -i Makefile.vars";
 
   buildPhase = "make install";
 
-  # HOME=. allows to build missing TeX formats
   installPhase = ''
     mkdir -p $out/bin
     make install
-    HOME=. make documentation
-    mkdir -p $out/share/doc
-    cp -r DOC $out/share/doc/EProver
     echo eproof -xAuto --tstp-in --tstp-out '"$@"' > $out/bin/eproof-tptp
     chmod a+x $out/bin/eproof-tptp
   '';
 
   meta = {
     inherit (s) version;
-    description = "E automated theorem prover";
+    description = "Automated theorem prover for full first-order logic with equality";
     maintainers = [stdenv.lib.maintainers.raskin];
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/science/math/glsurf/default.nix b/pkgs/applications/science/math/glsurf/default.nix
index 1439d327d6e..2c09f572d12 100644
--- a/pkgs/applications/science/math/glsurf/default.nix
+++ b/pkgs/applications/science/math/glsurf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchdarcs, ocaml, findlib,  lablgl, camlimages, mesa, freeglut, ocaml_mysql, mlgmp, mpfr, gmp, libtiff, libjpeg, libpng, giflib }:
+{ stdenv, fetchdarcs, ocaml, findlib,  lablgl, camlimages, mesa, freeglut, ocaml_mysql, mysql, mlgmp, mpfr, gmp, libtiff, libjpeg, libpng, giflib }:
 
 let
   ocaml_version = (builtins.parseDrvName ocaml.name).version;
@@ -10,11 +10,11 @@ stdenv.mkDerivation {
   src = fetchdarcs {
     url = "http://lama.univ-savoie.fr/~raffalli/GlSurf";
     rev = "3.3";
-    sha256 = ""; md5="";
+    sha256 = "0ljvvzz31j7l8rvsv63x1kj70nhw3al3k294m79hpmwjvym1mzfa";
   };
 
   buildInputs = [ ocaml findlib freeglut mesa
-  	          lablgl camlimages ocaml_mysql mlgmp mpfr gmp
+  	          lablgl camlimages ocaml_mysql mysql.lib mlgmp mpfr gmp
 		  libtiff libjpeg libpng giflib ];
 
   installPhase = ''
diff --git a/pkgs/applications/version-management/codeville/0.8.0.nix b/pkgs/applications/version-management/codeville/0.8.0.nix
deleted file mode 100644
index 0c0f3c4c19c..00000000000
--- a/pkgs/applications/version-management/codeville/0.8.0.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-args : with args; 
-
-if (! python ? dbSupport) || (! python.dbSupport) then 
-  throw ''Python DB4 support is required for codeville.'' 
-else
-
-rec {
-  src = fetchurl {
-    url = http://codeville.org/download/Codeville-0.8.0.tar.gz;
-    sha256 = "1p8zc4ijwcwf5bxl34n8d44mlxk1zhbpca68r93ywxqkqm2aqz37";
-  };
-
-  buildInputs = [python makeWrapper];
-  configureFlags = [];
-
-  /* doConfigure should be specified separately */
-  phaseNames = ["installPythonPackage" (makeManyWrappers ''$out/bin/*'' ''--prefix PYTHONPATH : $(toPythonPath $out)'')];
-      
-  name = "codeville-0.8.0";
-  meta = {
-    description = "RCS with powerful merge";
-  };
-}
diff --git a/pkgs/applications/video/k9copy/default.nix b/pkgs/applications/video/k9copy/default.nix
index ad5dc58cbeb..70558eb39a4 100644
--- a/pkgs/applications/video/k9copy/default.nix
+++ b/pkgs/applications/video/k9copy/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, cmake, automoc4, kf5, dvdauthor, xineLib, libmpeg2, libav,
-libdvdread, libdvdnav, dvdplusrwtools }:
+{ stdenv, fetchurl, cmake, automoc4, qt5, kf5, dvdauthor, xineLib, libmpeg2, libav,
+libdvdread, libdvdnav, dvdplusrwtools, phonon_qt5 }:
 
 stdenv.mkDerivation rec {
   version = "3.0.3";
@@ -31,12 +31,12 @@ stdenv.mkDerivation rec {
     libdvdnav
     dvdplusrwtools
     automoc4
+    phonon_qt5
   ] ++ (with kf5; [
     extra-cmake-modules
     kio
     solid
-    scope.Phonon4Qt5
-    scope.Qt5X11Extras
+    qt5.x11extras
     kiconthemes
     ki18n
     kdesu
diff --git a/pkgs/applications/video/obs-studio/default.nix b/pkgs/applications/video/obs-studio/default.nix
index 894a51c58cc..953f0c3a8b2 100644
--- a/pkgs/applications/video/obs-studio/default.nix
+++ b/pkgs/applications/video/obs-studio/default.nix
@@ -7,9 +7,14 @@
 , qt5
 , libv4l
 , x264
+
+, pulseaudioSupport ? false
+, libpulseaudio
 }:
 
-stdenv.mkDerivation rec {
+let
+  optional = stdenv.lib.optional;
+in stdenv.mkDerivation rec {
   name = "obs-studio-${version}";
   version = "0.10.0";
 
@@ -26,7 +31,8 @@ stdenv.mkDerivation rec {
                   qt5.base
                   qt5.x11extras
                   x264
-                ];
+                ]
+                ++ optional pulseaudioSupport libpulseaudio;
 
   # obs attempts to dlopen libobs-opengl, it fails unless we make sure
   # DL_OPENGL is an explicit path. Not sure if there's a better way
diff --git a/pkgs/applications/window-managers/stumpwm/default.nix b/pkgs/applications/window-managers/stumpwm/default.nix
index d44ac128d80..88faae64be7 100644
--- a/pkgs/applications/window-managers/stumpwm/default.nix
+++ b/pkgs/applications/window-managers/stumpwm/default.nix
@@ -41,6 +41,8 @@ stdenv.mkDerivation rec {
 
   preBuild = ''
     cp -r --no-preserve=mode ${contrib} modules
+    substituteInPlace  head.lisp \
+      --replace 'run-shell-command "xdpyinfo' 'run-shell-command "${xdpyinfo}/bin/xdpyinfo'
   '';
 
   installPhase = ''
diff --git a/pkgs/desktops/gnome-3/3.16/core/gnome-control-center/default.nix b/pkgs/desktops/gnome-3/3.16/core/gnome-control-center/default.nix
index e2ec96b5469..0c676c38efa 100644
--- a/pkgs/desktops/gnome-3/3.16/core/gnome-control-center/default.nix
+++ b/pkgs/desktops/gnome-3/3.16/core/gnome-control-center/default.nix
@@ -2,7 +2,7 @@
 , libcanberra, libcanberra_gtk3, accountsservice, libpwquality, libpulseaudio, fontconfig
 , gdk_pixbuf, hicolor_icon_theme, librsvg, libxkbfile, libnotify
 , libxml2, polkit, libxslt, libgtop, libsoup, colord, colord-gtk
-, cracklib, python, krb5, networkmanagerapplet, networkmanager
+, cracklib, python, libkrb5, networkmanagerapplet, networkmanager
 , libwacom, samba, shared_mime_info, tzdata, icu, libtool, udev
 , docbook_xsl, docbook_xsl_ns, modemmanager, clutter, clutter_gtk }:
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     [ pkgconfig intltool ibus gtk glib upower libcanberra gsettings_desktop_schemas
       libxml2 gnome_desktop gnome_settings_daemon polkit libxslt libgtop gnome-menus
       gnome_online_accounts libsoup colord libpulseaudio fontconfig colord-gtk libpwquality
-      accountsservice krb5 networkmanagerapplet libwacom samba libnotify libxkbfile
+      accountsservice libkrb5 networkmanagerapplet libwacom samba libnotify libxkbfile
       shared_mime_info icu libtool docbook_xsl docbook_xsl_ns gnome3.grilo
       gdk_pixbuf gnome3.defaultIconTheme librsvg clutter clutter_gtk
       gnome3.vino udev libcanberra_gtk3
diff --git a/pkgs/desktops/gnome-3/3.16/default.nix b/pkgs/desktops/gnome-3/3.16/default.nix
index 7387ee710d0..cc825f0cc6c 100644
--- a/pkgs/desktops/gnome-3/3.16/default.nix
+++ b/pkgs/desktops/gnome-3/3.16/default.nix
@@ -16,6 +16,7 @@ let
   corePackages = with gnome3; [
     pkgs.desktop_file_utils pkgs.ibus
     pkgs.shared_mime_info # for update-mime-database
+    glib # for gsettings
     gtk3 # for gtk-update-icon-cache
     glib_networking gvfs dconf gnome-backgrounds gnome_control_center
     gnome-menus gnome_settings_daemon gnome_shell
diff --git a/pkgs/development/compilers/hhvm/default.nix b/pkgs/development/compilers/hhvm/default.nix
index 72bdabb4349..a5586117588 100644
--- a/pkgs/development/compilers/hhvm/default.nix
+++ b/pkgs/development/compilers/hhvm/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchgit, cmake, pkgconfig, boost, libunwind, libmemcached, pcre
 , libevent, gd, curl, libxml2, icu, flex, bison, openssl, zlib, php, re2c
-, expat, libcap, oniguruma, libdwarf, libmcrypt, tbb, gperftools, glog, krb5
+, expat, libcap, oniguruma, libdwarf, libmcrypt, tbb, gperftools, glog, libkrb5
 , bzip2, openldap, readline, libelf, uwimap, binutils, cyrus_sasl, pam, libpng
 , libxslt, ocaml, freetype, gdb, git, perl, mariadb, gmp, libyaml, libedit
 , libvpx, imagemagick, fribidi
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     [ cmake pkgconfig boost libunwind mariadb libmemcached pcre gdb git perl
       libevent gd curl libxml2 icu flex bison openssl zlib php expat libcap
       oniguruma libdwarf libmcrypt tbb gperftools bzip2 openldap readline
-      libelf uwimap binutils cyrus_sasl pam glog libpng libxslt ocaml krb5
+      libelf uwimap binutils cyrus_sasl pam glog libpng libxslt ocaml libkrb5
       gmp libyaml libedit libvpx imagemagick fribidi
     ];
 
diff --git a/pkgs/development/compilers/ocaml/4.02.1.nix b/pkgs/development/compilers/ocaml/4.02.1.nix
index 6f4cce522e4..d70fe3384e0 100644
--- a/pkgs/development/compilers/ocaml/4.02.1.nix
+++ b/pkgs/development/compilers/ocaml/4.02.1.nix
@@ -9,6 +9,10 @@ assert useX11 -> !stdenv.isArm && !stdenv.isMips;
 let
    useNativeCompilers = !stdenv.isMips;
    inherit (stdenv.lib) optionals optionalString;
+   patchOcamlBuild = fetchurl {
+     url = https://github.com/ocaml/ocaml/pull/117.patch;
+     sha256 = "0x2cdn2sgzq29qzqg5y2ial0jqy8gjg5a7jf8qqch55dc4vkyjw0";
+   };
 in
 
 stdenv.mkDerivation rec {
@@ -24,6 +28,8 @@ stdenv.mkDerivation rec {
     sha256 = "1p7lqvh64xpykh99014mz21q8fs3qyjym2qazhhbq8scwldv1i38";
   };
 
+  patches = [ patchOcamlBuild ];
+
   prefixKey = "-prefix ";
   configureFlags = optionals useX11 [ "-x11lib" x11lib
                                       "-x11include" x11inc ];
diff --git a/pkgs/development/interpreters/erlang/R18.nix b/pkgs/development/interpreters/erlang/R18.nix
new file mode 100644
index 00000000000..9bc36ee47de
--- /dev/null
+++ b/pkgs/development/interpreters/erlang/R18.nix
@@ -0,0 +1,87 @@
+{ stdenv, fetchurl, perl, gnum4, ncurses, openssl
+, gnused, gawk, makeWrapper
+, odbcSupport ? false, unixODBC ? null
+, wxSupport ? true, mesa ? null, wxGTK ? null, xlibs ? null, wxmac ? null
+, javacSupport ? false, openjdk ? null
+, enableHipe ? true
+}:
+
+assert wxSupport -> (if stdenv.isDarwin
+  then wxmac != null
+  else mesa != null && wxGTK != null && xlibs != null);
+
+assert odbcSupport -> unixODBC != null;
+assert javacSupport ->  openjdk != null;
+
+with stdenv.lib;
+
+stdenv.mkDerivation rec {
+  name = "erlang-" + version + "${optionalString odbcSupport "-odbc"}"
+  + "${optionalString javacSupport "-javac"}";
+  version = "18.0";
+
+  src = fetchurl {
+    url = "http://www.erlang.org/download/otp_src_${version}.tar.gz";
+    sha256 = "1ahi865ii3iqzd00yyn3nrxjb9qa2by9d7ixssvqw8ag9firvdm0";
+  };
+
+  buildInputs =
+    [ perl gnum4 ncurses openssl makeWrapper
+    ] ++ optional wxSupport (if stdenv.isDarwin then [ wxmac ] else [ mesa wxGTK xlibs.libX11 ])
+      ++ optional odbcSupport [ unixODBC ]
+      ++ optional javacSupport [ openjdk ];
+
+  patchPhase = '' sed -i "s@/bin/rm@rm@" lib/odbc/configure erts/configure '';
+
+  preConfigure = ''
+    export HOME=$PWD/../
+    sed -e s@/bin/pwd@pwd@g -i otp_build
+  '';
+
+  configureFlags= [
+    "--with-ssl=${openssl}"
+  ] ++ optional enableHipe "--enable-hipe"
+    ++ optional wxSupport "--enable-wx"
+    ++ optional odbcSupport "--with-odbc=${unixODBC}"
+    ++ optional javacSupport "--with-javac"
+    ++ optional stdenv.isDarwin "--enable-darwin-64bit";
+
+  postInstall = let
+    manpages = fetchurl {
+      url = "http://www.erlang.org/download/otp_doc_man_${version}.tar.gz";
+      sha256 = "0wsnp7sp21ydinwkg3rkazyrs382pdzwra9apikkhs70dv1hwkz4";
+    };
+  in ''
+    ln -s $out/lib/erlang/lib/erl_interface*/bin/erl_call $out/bin/erl_call
+    tar xf "${manpages}" -C "$out/lib/erlang"
+    for i in "$out"/lib/erlang/man/man[0-9]/*.[0-9]; do
+      prefix="''${i%/*}"
+      ensureDir "$out/share/man/''${prefix##*/}"
+      ln -s "$i" "$out/share/man/''${prefix##*/}/''${i##*/}erl"
+    done
+  '';
+
+  # Some erlang bin/ scripts run sed and awk
+  postFixup = ''
+    wrapProgram $out/lib/erlang/bin/erl --prefix PATH ":" "${gnused}/bin/"
+    wrapProgram $out/lib/erlang/bin/start_erl --prefix PATH ":" "${gnused}/bin/:${gawk}/bin"
+  '';
+
+  meta = {
+    homepage = "http://www.erlang.org/";
+    description = "Programming language used for massively scalable soft real-time systems";
+
+    longDescription = ''
+      Erlang is a programming language used to build massively scalable
+      soft real-time systems with requirements on high availability.
+      Some of its uses are in telecoms, banking, e-commerce, computer
+      telephony and instant messaging. Erlang's runtime system has
+      built-in support for concurrency, distribution and fault
+      tolerance.
+    '';
+
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ the-kenny sjmackenzie couchemar ];
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/development/libraries/libtsm/darwin.patch b/pkgs/development/libraries/libtsm/darwin.patch
new file mode 100644
index 00000000000..d447be456e0
--- /dev/null
+++ b/pkgs/development/libraries/libtsm/darwin.patch
@@ -0,0 +1,37 @@
+From 4e7b7b1124bfbccb43820997164b00720bf5ca31 Mon Sep 17 00:00:00 2001
+From: Florian Gilcher <florian.gilcher@asquera.de>
+Date: Sun, 23 Mar 2014 23:05:44 +0100
+Subject: [PATCH] Remove GCC specific flags
+
+---
+ Makefile.am | 10 ++--------
+ 1 file changed, 2 insertions(+), 8 deletions(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index f1e872b..c011f02 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -69,11 +69,7 @@ AM_CFLAGS = \
+ AM_CPPFLAGS = \
+ 	-include $(top_builddir)/config.h \
+ 	-I $(srcdir)/src
+-AM_LDFLAGS = \
+-	-Wl,--as-needed \
+-	-Wl,--gc-sections \
+-	-Wl,-z,relro \
+-	-Wl,-z,now
++AM_LDFLAGS =
+ 
+ if BUILD_ENABLE_DEBUG
+ AM_CFLAGS += -g
+@@ -134,9 +130,7 @@ libtsm_la_CPPFLAGS = $(AM_CPPFLAGS)
+ libtsm_la_LIBADD = libshl.la
+ EXTRA_libtsm_la_DEPENDENCIES = $(top_srcdir)/docs/libtsm.sym
+ libtsm_la_LDFLAGS = \
+-	$(AM_LDFLAGS) \
+-	-version-info $(LIBTSM_CURRENT):$(LIBTSM_REVISION):$(LIBTSM_AGE) \
+-	-Wl,--version-script="$(top_srcdir)/docs/libtsm.sym"
++	$(AM_LDFLAGS)
+ 
+ if BUILD_HAVE_XKBCOMMON
+ libtsm_la_CPPFLAGS += $(XKBCOMMON_CFLAGS)
diff --git a/pkgs/development/libraries/libtsm/default.nix b/pkgs/development/libraries/libtsm/default.nix
index 66e1698b11d..febdb0914d6 100644
--- a/pkgs/development/libraries/libtsm/default.nix
+++ b/pkgs/development/libraries/libtsm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libxkbcommon, pkgconfig }:
+{ stdenv, lib, fetchurl, libxkbcommon, pkgconfig, autoconf, automake }:
 
 stdenv.mkDerivation rec {
   name = "libtsm-3";
@@ -8,14 +8,22 @@ stdenv.mkDerivation rec {
     sha256 = "01ygwrsxfii0pngfikgqsb4fxp8n1bbs47l7hck81h9b9bc1ah8i";
   };
 
-  buildInputs = [ libxkbcommon pkgconfig ];
+  buildInputs = [ libxkbcommon pkgconfig ] ++ lib.optionals stdenv.isDarwin [
+    autoconf automake
+   ];
+
+  preConfigure = lib.optionalString stdenv.isDarwin ''
+    aclocal
+  '';
 
   configureFlags = [ "--disable-debug" ];
 
-  meta = {
+  patches = lib.optional stdenv.isDarwin ./darwin.patch;
+
+  meta = with lib; {
     description = "Terminal-emulator State Machine";
     homepage = "http://www.freedesktop.org/wiki/Software/kmscon/libtsm/";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.shlevy ];
+    license = licenses.mit;
+    maintainers = with maintainers; [ shlevy cstrahan ];
   };
 }
diff --git a/pkgs/development/libraries/ti-rpc/default.nix b/pkgs/development/libraries/ti-rpc/default.nix
index b135e49f52b..eb795d6b28e 100644
--- a/pkgs/development/libraries/ti-rpc/default.nix
+++ b/pkgs/development/libraries/ti-rpc/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, krb5 }:
+{ fetchurl, stdenv, libkrb5 }:
 
 stdenv.mkDerivation rec {
   name = "libtirpc-0.3.0";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "07d1wlfzf3ia09mjn3f3ay8isk7yx4a6ckfkzx5khnqlc7amkzna";
   };
 
-  propagatedBuildInputs = [ krb5 ];
+  propagatedBuildInputs = [ libkrb5 ];
 
   # http://www.sourcemage.org/projects/grimoire/repository/revisions/d6344b6a3a94b88ed67925a474de5930803acfbf
   preConfigure = ''
diff --git a/pkgs/development/ocaml-modules/bolt/default.nix b/pkgs/development/ocaml-modules/bolt/default.nix
index 9b0efd816bd..61c3d6f23b4 100644
--- a/pkgs/development/ocaml-modules/bolt/default.nix
+++ b/pkgs/development/ocaml-modules/bolt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, findlib, which }:
+{ stdenv, fetchurl, ocaml, findlib, which, camlp4 }:
 
 let inherit (stdenv.lib) getVersion versionAtLeast; in
 
@@ -14,7 +14,20 @@ stdenv.mkDerivation rec {
     sha256 = "1c807wrpxra9sbb34lajhimwra28ldxv04m570567lh2b04n38zy";
   };
 
-  buildInputs = [ ocaml findlib which ];
+  buildInputs = [ ocaml findlib which camlp4 ];
+
+  patchPhase = ''
+    patch myocamlbuild.ml <<EOF
+70,74c70
+<         let camlp4of =
+<           try
+<             let path_bin = Filename.concat (Sys.getenv "PATH_OCAML_PREFIX") "bin" in
+<             Filename.concat path_bin "camlp4of"
+<           with _ -> "camlp4of" in
+---
+>         let camlp4of = "camlp4of" in
+EOF
+  '';
 
   # The custom `configure` script does not expect the --prefix
   # option. Installation is handled by ocamlfind.
diff --git a/pkgs/development/ocaml-modules/eliom/camlp4.patch b/pkgs/development/ocaml-modules/eliom/camlp4.patch
new file mode 100644
index 00000000000..561d5305bef
--- /dev/null
+++ b/pkgs/development/ocaml-modules/eliom/camlp4.patch
@@ -0,0 +1,24 @@
+--- a/src/_tags	2014-10-01 16:19:35.000000000 +0100
++++ b/src/_tags	2014-11-09 16:55:34.470663377 +0000
+@@ -39,7 +39,7 @@
+ <lib/server/monitor/*.ml{,i}>:I(src/lib/server)
+ 
+ <syntax/pa_*.ml{,i}>: syntax(camlp4o),package(camlp4.quotations.o,camlp4.extend)
+-<syntax/pa_*.ml{,i}>: I(+camlp4/Camlp4Parsers)
++<syntax/pa_*.ml{,i}>: use_camlp4_full
+ 
+ 
+ <ocamlbuild/ocamlbuild_eliom.ml{,i}>: package(ocamlbuild,js_of_ocaml.ocamlbuild)
+
+--- a/src/lib/eliom_registration.server.ml	2014-10-01 16:19:35.000000000 +0100
++++ b/src/lib/eliom_registration.server.ml	2014-11-09 17:26:16.093198699 +0000
+@@ -2440,7 +2440,7 @@
+       (Ocaml.register_post_coservice'
+          ?scope ?options ?charset ?code ?content_type ?headers ?secure_session ?name
+          ?csrf_safe ?csrf_scope ?csrf_secure ?max_use ?timeout ?https ?error_handler
+-         ~post_params:Eliom_parameter.(ocaml "argument" argument_type)
++         ~post_params:(Eliom_parameter.ocaml "argument" argument_type)
+          (fun () argument -> f argument))
+       (Eliom_wrap.create_unwrapper
+          (Eliom_wrap.id_of_int Eliom_common_base.server_function_unwrap_id_int))
+
diff --git a/pkgs/development/ocaml-modules/eliom/default.nix b/pkgs/development/ocaml-modules/eliom/default.nix
index 54644d83699..7fe26863b3d 100644
--- a/pkgs/development/ocaml-modules/eliom/default.nix
+++ b/pkgs/development/ocaml-modules/eliom/default.nix
@@ -14,6 +14,8 @@ stdenv.mkDerivation rec
     sha256 = "10v7mrq3zsbxdlg8k8xif777mbvcdpabvnd1g7p2yqivr7f1qm24";
   };
 
+  patches = [ ./camlp4.patch ];
+
   buildInputs = [ocaml which ocsigen_server findlib ocsigen_deriving
                  js_of_ocaml ocaml_optcomp opam];
 
diff --git a/pkgs/development/ocaml-modules/lablgtk/2.14.0.nix b/pkgs/development/ocaml-modules/lablgtk/2.14.0.nix
index 2e50b897f3d..1815bfc64dd 100644
--- a/pkgs/development/ocaml-modules/lablgtk/2.14.0.nix
+++ b/pkgs/development/ocaml-modules/lablgtk/2.14.0.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, ocaml, findlib, pkgconfig, gtk, libgnomecanvas, libglade, gtksourceview}:
+{ stdenv, fetchurl, ocaml, findlib, pkgconfig, gtk, libgnomecanvas, libglade, gtksourceview, camlp4 }:
 
 let
   ocaml_version = (builtins.parseDrvName ocaml.name).version;
@@ -14,7 +14,7 @@ stdenv.mkDerivation (rec {
     sha256 = "1fnh0amm7lwgyjdhmlqgsp62gwlar1140425yc1j6inwmgnsp0a9";
   };
 
-  buildInputs = [ocaml findlib pkgconfig gtk libgnomecanvas libglade gtksourceview];
+  buildInputs = [ ocaml findlib pkgconfig gtk libgnomecanvas libglade gtksourceview camlp4 ];
 
   configureFlags = "--with-libdir=$(out)/lib/ocaml/${ocaml_version}/site-lib";
   buildFlags = "world";
diff --git a/pkgs/development/ocaml-modules/mysql/default.nix b/pkgs/development/ocaml-modules/mysql/default.nix
index 4ffef60c4bf..fc26d8b989c 100644
--- a/pkgs/development/ocaml-modules/mysql/default.nix
+++ b/pkgs/development/ocaml-modules/mysql/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, ocaml, findlib, mysql}:
+{ stdenv, fetchurl, ocaml, findlib, mysql, camlp4 }:
 
 # TODO: la versione stabile da' un errore di compilazione dovuto a
 # qualche cambiamento negli header .h
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
      "--libdir=$out/lib/ocaml/${ocaml_version}/site-lib/mysql"
   ];
 
-  buildInputs = [ocaml findlib mysql.lib ];
+  buildInputs = [ocaml findlib mysql.lib camlp4 ];
 
   createFindlibDestdir = true;
 
diff --git a/pkgs/development/ocaml-modules/ulex/default.nix b/pkgs/development/ocaml-modules/ulex/default.nix
index 28950078f39..7c8acafe769 100644
--- a/pkgs/development/ocaml-modules/ulex/default.nix
+++ b/pkgs/development/ocaml-modules/ulex/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, ocaml, findlib }:
+{ stdenv, fetchurl, ocaml, findlib, camlp4 }:
 
 let
   ocaml_version = (builtins.parseDrvName ocaml.name).version;
@@ -17,7 +17,8 @@ stdenv.mkDerivation {
 
   createFindlibDestdir = true;
 
-  buildInputs = [ocaml findlib];
+  buildInputs = [ ocaml findlib ];
+  propagatedBuildInputs = [ camlp4 ];
 
   buildFlags = "all all.opt";
 
diff --git a/pkgs/development/tools/misc/autobuild/default.nix b/pkgs/development/tools/misc/autobuild/default.nix
index b35ec4357c4..f3d88361a11 100644
--- a/pkgs/development/tools/misc/autobuild/default.nix
+++ b/pkgs/development/tools/misc/autobuild/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, makeWrapper, perl, openssh, rsync }:
 
 stdenv.mkDerivation rec {
-  name = "autobuild-3.5";
+  name = "autobuild-5.3";
 
   src = fetchurl {
     url = "http://savannah.spinellicreations.com/autobuild/${name}.tar.gz";
-    sha256 = "0ik13913x1yj8lsaf65chpiw13brl3q6kx7s1fa41a7s2krl1xvi";
+    sha256 = "0gv7g61ja9q9zg1m30k4snqwwy1kq7b4df6sb7d2qra7kbdq8af1";
   };
 
   buildInputs = [ makeWrapper perl openssh rsync ];
diff --git a/pkgs/development/tools/ocaml/js_of_ocaml/default.nix b/pkgs/development/tools/ocaml/js_of_ocaml/default.nix
index 9989afdefc4..eaabd50059d 100644
--- a/pkgs/development/tools/ocaml/js_of_ocaml/default.nix
+++ b/pkgs/development/tools/ocaml/js_of_ocaml/default.nix
@@ -9,8 +9,8 @@ stdenv.mkDerivation {
     };
   
   buildInputs = [ocaml findlib menhir ocsigen_deriving
-                 cmdliner tyxml camlp4 reactivedata];
-  propagatedBuildInputs = [ ocaml_lwt ];
+                 cmdliner tyxml reactivedata];
+  propagatedBuildInputs = [ ocaml_lwt camlp4 ];
 
   patches = [ ./Makefile.conf.diff ];  
 
diff --git a/pkgs/misc/vim-plugins/default.nix b/pkgs/misc/vim-plugins/default.nix
index 28db4c343c1..6f6c8fd6e7b 100644
--- a/pkgs/misc/vim-plugins/default.nix
+++ b/pkgs/misc/vim-plugins/default.nix
@@ -81,14 +81,13 @@ rec {
   watchdogs           = vim-watchdogs;
   webapi-vim          = WebAPI;
   yankring            = YankRing;
-  
 
   Gist = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "Gist-2015-06-09";
+    name = "Gist-2015-06-24";
     src = fetchgit {
       url = "git://github.com/mattn/gist-vim";
-      rev = "c39e5e317d88da71da338c07af492c7a27efcf0a";
-      sha256 = "97fa171cf239b54ee4ab102dd9f87810744bfa3edd34fe04d4dd8a879b22d5b4";
+      rev = "297c4b90511b6daf7b35c219652a56ac2f0209ee";
+      sha256 = "f7da15fd5c4dbd0e7fb5a66b7212f11db1f05ccbe53ccc06c9d3b1d4bd205923";
     };
     dependencies = [];
 
@@ -139,11 +138,11 @@ rec {
   };
 
   Syntastic = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "Syntastic-2015-06-12";
+    name = "Syntastic-2015-06-26";
     src = fetchgit {
       url = "git://github.com/scrooloose/syntastic";
-      rev = "b8682c3029de5913e0a63a45e5f4d6f3b5e4920e";
-      sha256 = "6ec2a6a3b4b3998612d21fcdccdb82799f8cf4022d6bc38e16f85ece8692d3a3";
+      rev = "8e672780e76c0a774b7fe834eed9652ccd684c24";
+      sha256 = "10b113c456387ebe2b08f81f6464408382a525d9b37e4e6b3fd54808dd25c1a4";
     };
     dependencies = [];
 
@@ -161,11 +160,11 @@ rec {
   };
 
   Tagbar = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "Tagbar-2015-05-10";
+    name = "Tagbar-2015-06-19";
     src = fetchgit {
       url = "git://github.com/majutsushi/tagbar";
-      rev = "399b75256ac7333d7119d11047f6b3aff8fa2828";
-      sha256 = "8562fac0f2d690537b4c1049ba67b440116135167b48b9feb21655c9931b875c";
+      rev = "7b36c46d17d57db34fdb0adac9ba6382d0bb5e66";
+      sha256 = "346773e772772d1c68318effd8e6c8c8b36f61cfd9c72a85c0bfcec9843f13c7";
     };
     dependencies = [];
 
@@ -183,11 +182,11 @@ rec {
   };
 
   The_NERD_tree = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "The_NERD_tree-2015-05-13";
+    name = "The_NERD_tree-2015-06-17";
     src = fetchgit {
       url = "git://github.com/scrooloose/nerdtree";
-      rev = "af85499edace2acca27ce41790ac333f62b689bb";
-      sha256 = "12f68eb374ccc8cbfcf88b85cf44a4a18856be4e30a50850b8f3d0b186207f0c";
+      rev = "96c07746b46c12d0aca7a5276cc5bd0a260b82fe";
+      sha256 = "0a3854121674fed598b21154f749a5eadd590a2e5632dd6fc8a9307bdb4cf4d8";
     };
     dependencies = [];
 
@@ -364,11 +363,11 @@ rec {
   };
 
   idris-vim = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "idris-vim-2014-12-29";
+    name = "idris-vim-2015-06-23";
     src = fetchgit {
       url = "git://github.com/idris-hackers/idris-vim";
-      rev = "6bdb44b85406b75e3b3a4fa265deab1dbe8c6ff1";
-      sha256 = "87677f3aa81f15dbaf4337f709952fd47c9fa28e8086033f2cfbd5b1f256e5ff";
+      rev = "4c1723c34a434aad2455c7c2f2a30d97ed691191";
+      sha256 = "db09ad5a7c75d9ac2ccb1be2b85d6ed9cd507ec0fc736e994d8d315c5916170d";
     };
     dependencies = [];
 
@@ -397,11 +396,11 @@ rec {
   };
 
   vim-ipython = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "vim-ipython-2015-05-30";
+    name = "vim-ipython-2015-06-23";
     src = fetchgit {
       url = "git://github.com/ivanov/vim-ipython";
-      rev = "5876b483902313143adc2dcdfd8de94036e191a6";
-      sha256 = "6c0f3011dca269d8c862abb5477bcdbe3ec2fbe4fc6cebeb38e7f0816cedaae5";
+      rev = "42499f094b805b90b683afa5009cee99abd0bb75";
+      sha256 = "7f59c3edde4c2b8555d703c96e855ca36665aacdca5a30d1e9e21c31bc252f2d";
     };
     dependencies = [];
 
@@ -507,11 +506,11 @@ rec {
   };
 
   vim-easymotion = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "vim-easymotion-2015-04-21";
+    name = "vim-easymotion-2015-06-22";
     src = fetchgit {
       url = "git://github.com/lokaltog/vim-easymotion";
-      rev = "9f1c449edfce6d61c7f620e3a9c1389b7b7e334f";
-      sha256 = "ba358f3acc120d9cf1854205bde0fa345d156e7f69a1854987e74bb137889c54";
+      rev = "ef0cb2b0a0feee865e70c42fdaf03a4f8e621f38";
+      sha256 = "13f0d18f0c822dc7ba99f2365539de1e2c63817b89a6d0d2e9c2e8689ee85cb7";
     };
     dependencies = [];
 
@@ -566,11 +565,11 @@ rec {
   };
 
   racer = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "racer-2015-06-15";
+    name = "racer-2015-06-24";
     src = fetchgit {
       url = "git://github.com/phildawes/racer";
-      rev = "dd0671b8d6e66e3e503bd7049561fb08e7815ed3";
-      sha256 = "ec996e7cbf46aec545b70781108f4290dacecd02b599a0d13b8b0cf431205403";
+      rev = "8f9d14b381a1624389df78ed8d3a38bc1c85d0f4";
+      sha256 = "34db058ca1d5dd979db1208b5f90716145eb416c931445213a8dfac3d8b0bcdb";
     };
     dependencies = [];
     buildPhase = ''
@@ -580,33 +579,33 @@ rec {
   };
 
   neocomplete-vim = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "neocomplete-vim-2015-06-15";
+    name = "neocomplete-vim-2015-06-23";
     src = fetchgit {
       url = "git://github.com/shougo/neocomplete.vim";
-      rev = "15c6a63ca8807493df273c77be0754f44d68d30b";
-      sha256 = "1a2a30da610e5f252bbe43717cf2cad76b8b09916c2082541fc3bb456b9b97a9";
+      rev = "72bf34c349078ae0e4691f7e00dd2a7ab5714a69";
+      sha256 = "72dff487613de3e18c561b45658ec2eda66a686e1d73159c03bee1313d6d74ff";
     };
     dependencies = [];
 
   };
 
   neosnippet-snippets = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "neosnippet-snippets-2015-06-11";
+    name = "neosnippet-snippets-2015-06-26";
     src = fetchgit {
       url = "git://github.com/shougo/neosnippet-snippets";
-      rev = "522c38e28949ae53af8c96d7bcbda192b92e3656";
-      sha256 = "ff0c09fb5a70e011cb7570951a67ef0253f544b3f61c8e7741d65d27b4d418c1";
+      rev = "81c7c9840352126d1fa3748c014d00188b5a1afa";
+      sha256 = "977ef9fd855a03ba16c01b990bfd4121eb3a4516e7446bcb8806c41490515ec3";
     };
     dependencies = [];
 
   };
 
   neosnippet-vim = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "neosnippet-vim-2015-06-13";
+    name = "neosnippet-vim-2015-06-23";
     src = fetchgit {
       url = "git://github.com/shougo/neosnippet.vim";
-      rev = "3cfe8368cfccffdeab660ca1019696e0fd1aa944";
-      sha256 = "049555be6a2aedee7fffc583d43c0cbe3aecc2f0efcf6cfab826e30b2e83f2fd";
+      rev = "f1980468b0a397d36318a409d3677bc13d307392";
+      sha256 = "b28bf490a809e4dee474480436e0aa1c64612e4788c4f9a0afe856cf2432cfaf";
     };
     dependencies = [];
 
@@ -629,11 +628,11 @@ rec {
   };
 
   vimshell-vim = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "vimshell-vim-2015-05-01";
+    name = "vimshell-vim-2015-06-21";
     src = fetchgit {
       url = "git://github.com/shougo/vimshell.vim";
-      rev = "4939e10609c434becf6423b2f3876bb9c2be3464";
-      sha256 = "72bc6ca7b8ebcdf1d4617c73fc2688486f71a9f8b8601627fbbada3a4cfb28ca";
+      rev = "ce5ce77133dd16bd33a57b0776de0cbaead45722";
+      sha256 = "7c44556f28a06083ba9485af74fcc2e510e3e1830cfce6670c899329c2c85012";
     };
     dependencies = [ "vimproc-vim" ];
   };
@@ -683,11 +682,11 @@ rec {
   };
 
   youcompleteme = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "youcompleteme-2015-06-12";
+    name = "youcompleteme-2015-06-23";
     src = fetchgit {
       url = "git://github.com/valloric/youcompleteme";
-      rev = "d77ef96ebcca90381f38604d7fb2e90da91bd503";
-      sha256 = "7a794986eebd8fa952be3dc903588d124dd14377a07bff1b877279c3b7d498f9";
+      rev = "66dcc9581c7d237f4d839389bee055df6788fbc9";
+      sha256 = "91971f0640d462622a31ea64c5c41df7649a6c6e6e4d93220554a7d910a11fdf";
     };
     dependencies = [];
     buildInputs = [
@@ -773,11 +772,11 @@ rec {
   };
 
   vim-wakatime = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "vim-wakatime-2015-06-11";
+    name = "vim-wakatime-2015-06-23";
     src = fetchgit {
       url = "git://github.com/wakatime/vim-wakatime";
-      rev = "b2dcc7ccc2247274fe63168952de5db595a01e1c";
-      sha256 = "883f92fcd45a824009e613d8a527effd1eac8bef0fe4299c0df366376afb6273";
+      rev = "2ee2b4ea56ae1b56ce77a1b9e5d2c51fc6768842";
+      sha256 = "440b6027921fce801255eedd29d24b43975038e78dfe465a381ae76e443480c2";
     };
     dependencies = [];
     buildInputs = [ python ];
@@ -1174,11 +1173,11 @@ rec {
   };
 
   vim-airline = buildVimPluginFrom2Nix { # created by nix#NixDerivation
-    name = "vim-airline-2015-06-09";
+    name = "vim-airline-2015-06-26";
     src = fetchgit {
       url = "git://github.com/bling/vim-airline";
-      rev = "b29e01fa22ee8b8eb02cf505382a90b045b4bc64";
-      sha256 = "e943dd5900d4d49a6f7dd02434b394167a3802d68d17072fc767552a9fd16001";
+      rev = "9afda181dddd0a0ae34aa10e7faad4a66e94676b";
+      sha256 = "1e3b540353b4e047de7c26d8e02de5e68c02a5a1fccc946faa494bcad44bc6b1";
     };
     dependencies = [];
 
@@ -1306,8 +1305,6 @@ rec {
     meta = {
        url = "http://www.vim.org/scripts/script.php?script_id=2465";
     };
-
-
   };
 
 }
diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix
index a972c4e60f8..cb7423f293a 100644
--- a/pkgs/os-specific/linux/kernel/common-config.nix
+++ b/pkgs/os-specific/linux/kernel/common-config.nix
@@ -396,7 +396,7 @@ with stdenv.lib;
     KVM_CLOCK? y
   ''}
   ${optionalString (versionAtLeast version "4.0") ''
-    KVM_COMPAT y
+    KVM_COMPAT? y
   ''}
   ${optionalString (versionAtLeast version "3.10") ''
     KVM_DEVICE_ASSIGNMENT? y
diff --git a/pkgs/servers/nosql/cassandra/2.0.nix b/pkgs/servers/nosql/cassandra/2.0.nix
index e3ed35241fa..a4aca1c55c1 100644
--- a/pkgs/servers/nosql/cassandra/2.0.nix
+++ b/pkgs/servers/nosql/cassandra/2.0.nix
@@ -6,6 +6,7 @@
 , gawk
 , bash
 , getopt
+, procps
 }:
 
 let
@@ -34,7 +35,8 @@ stdenv.mkDerivation rec {
         --set JAVA_HOME ${jre} \
         --prefix PATH : ${bash}/bin \
         --prefix PATH : ${getopt}/bin \
-        --prefix PATH : ${gawk}/bin
+        --prefix PATH : ${gawk}/bin \
+        --prefix PATH : ${procps}/bin
     done
 
     wrapProgram $out/bin/cqlsh --prefix PATH : ${python}/bin
diff --git a/pkgs/servers/nosql/cassandra/2.1.nix b/pkgs/servers/nosql/cassandra/2.1.nix
index 2f8cb84117a..f82daee7b14 100644
--- a/pkgs/servers/nosql/cassandra/2.1.nix
+++ b/pkgs/servers/nosql/cassandra/2.1.nix
@@ -6,6 +6,7 @@
 , gawk
 , bash
 , getopt
+, procps
 }:
 
 let
@@ -34,7 +35,8 @@ stdenv.mkDerivation rec {
         --set JAVA_HOME ${jre} \
         --prefix PATH : ${bash}/bin \
         --prefix PATH : ${getopt}/bin \
-        --prefix PATH : ${gawk}/bin
+        --prefix PATH : ${gawk}/bin \
+        --prefix PATH : ${procps}/bin
     done
 
     wrapProgram $out/bin/cqlsh --prefix PATH : ${python}/bin
diff --git a/pkgs/servers/vault/default.nix b/pkgs/servers/vault/default.nix
new file mode 100644
index 00000000000..ddaaca8083b
--- /dev/null
+++ b/pkgs/servers/vault/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchgit, go, gox }:
+
+let
+  name = "vault";
+  version = "0.1.2";
+  namespace = "github.com/hashicorp/vault";
+in
+stdenv.mkDerivation rec {
+  name = "vault-${version}";
+  rev = "v${version}";
+
+  src = fetchgit {
+    url = "https://github.com/hashicorp/vault";
+    sha256 = "a4267105dab56c6d0571f69ea0abc167c5debd3b6c0795b8b69e15a285e12f01";
+    rev = "refs/tags/${rev}";
+  };
+
+  buildInputs = [ go gox ];
+
+  buildPhase = ''
+    mkdir -p "$(dirname Godeps/_workspace/src/${namespace})"
+    ln -sf $src "Godeps/_workspace/src/${namespace}"
+    export GOPATH=$PWD/Godeps/_workspace
+    XC_OS=$(go env GOOS)
+    XC_ARCH=$(go env GOARCH)
+    mkdir -p bin/
+    gox \
+      -os "$XC_OS" \
+      -arch "$XC_ARCH" \
+      -ldflags "-X github.com/hashicorp/vault/cli.GitCommit ${rev}" \
+      -output $PWD/bin/vault \
+      -verbose \
+      .
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp bin/vault $out/bin/vault
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = "https://www.vaultproject.io";
+    description = "A tool for securely accessing secrets";
+    maintainers = with maintainers; [ avnik ];
+    license     = licenses.mit ;
+    platforms   = platforms.all;
+  };
+}
diff --git a/pkgs/tools/misc/file/default.nix b/pkgs/tools/misc/file/default.nix
index f4e89b197e6..e3dc7bcb533 100644
--- a/pkgs/tools/misc/file/default.nix
+++ b/pkgs/tools/misc/file/default.nix
@@ -6,7 +6,10 @@ stdenv.mkDerivation rec {
   buildInputs = [ zlib ];
 
   src = fetchurl {
-    url = "ftp://ftp.astron.com/pub/file/${name}.tar.gz";
+    urls = [
+      "ftp://ftp.astron.com/pub/file/${name}.tar.gz"
+      "http://distfiles.macports.org/file/${name}.tar.gz"
+    ];
     sha256 = "0z0mwqayrrf3w734rjp9rysf0y8az191ff7fxjsxyb1y2kzv72ic";
   };
 
diff --git a/pkgs/tools/misc/stow/default.nix b/pkgs/tools/misc/stow/default.nix
index a9d8554525b..6eddcf89b91 100644
--- a/pkgs/tools/misc/stow/default.nix
+++ b/pkgs/tools/misc/stow/default.nix
@@ -10,6 +10,8 @@ stdenv.mkDerivation {
 
   buildInputs = [ perl perlPackages.TestOutput ];
 
+  patches = [ ./precedence-issue.patch ];
+
   doCheck = true;
 
   meta = {
diff --git a/pkgs/tools/misc/stow/precedence-issue.patch b/pkgs/tools/misc/stow/precedence-issue.patch
new file mode 100644
index 00000000000..d9542573bac
--- /dev/null
+++ b/pkgs/tools/misc/stow/precedence-issue.patch
@@ -0,0 +1,15 @@
+diff --git a/lib/Stow.pm.in b/lib/Stow.pm.in
+index 101a422..f80b1ac 100755
+--- a/lib/Stow.pm.in
++++ b/lib/Stow.pm.in
+@@ -1732,8 +1732,8 @@ sub read_a_link {
+     }
+     elsif (-l $path) {
+         debug(4, "  read_a_link($path): real link");
+-        return readlink $path
+-            or error("Could not read link: $path");
++        my $target = readlink $path or error("Could not read link: $path ($!)");
++        return $target;
+     }
+     internal_error("read_a_link() passed a non link path: $path\n");
+ }
diff --git a/pkgs/tools/system/rsyslog/default.nix b/pkgs/tools/system/rsyslog/default.nix
index 0878902af86..e3e9d6a64d8 100644
--- a/pkgs/tools/system/rsyslog/default.nix
+++ b/pkgs/tools/system/rsyslog/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, libestr, json_c, zlib, pythonPackages
-, krb5 ? null, systemd ? null, jemalloc ? null, libmysql ? null, postgresql ? null
+, libkrb5 ? null, systemd ? null, jemalloc ? null, libmysql ? null, postgresql ? null
 , libdbi ? null, net_snmp ? null, libuuid ? null, curl ? null, gnutls ? null
 , libgcrypt ? null, liblognorm ? null, openssl ? null, librelp ? null
 , libgt ? null, liblogging ? null, libnet ? null, hadoop ? null, rdkafka ? null
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     pkgconfig libestr json_c zlib pythonPackages.docutils
-    krb5 jemalloc libmysql postgresql libdbi net_snmp libuuid curl gnutls
+    libkrb5 jemalloc libmysql postgresql libdbi net_snmp libuuid curl gnutls
     libgcrypt liblognorm openssl librelp libgt liblogging libnet hadoop rdkafka
     libmongo-client czmq rabbitmq-c hiredis
   ] ++ stdenv.lib.optional stdenv.isLinux systemd;
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     "--with-systemdsystemunitdir=\${out}/etc/systemd/system"
     (mkFlag true                      "largefile")
     (mkFlag true                      "regexp")
-    (mkFlag (krb5 != null)            "gssapi-krb5")
+    (mkFlag (libkrb5 != null)         "gssapi-krb5")
     (mkFlag true                      "klog")
     (mkFlag true                      "kmsg")
     (mkFlag (systemd != null)         "imjournal")
diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix
index b21c937e785..7e0a165ae89 100644
--- a/pkgs/tools/typesetting/tex/texlive/default.nix
+++ b/pkgs/tools/typesetting/tex/texlive/default.nix
@@ -1,6 +1,7 @@
 args : with args;
+
 rec {
-  src = fetchurl {
+  src = assert !config.inHydra or false; fetchurl {
     url = mirror://debian/pool/main/t/texlive-bin/texlive-bin_2014.20140926.35254.orig.tar.xz;
     sha256 = "1c39x059jhn5jsy6i9j3akjbkm1kmmzssy1jyi1aw20rl2vp86w3";
   };
@@ -147,5 +148,6 @@ rec {
     license     = stdenv.lib.licenses.gpl2;
     maintainers = with maintainers; [ lovek323 raskin jwiegley ];
     platforms   = platforms.unix;
+    hydraPlatforms = [];
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 4c68386b17c..1d86ca00d6c 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -100,6 +100,8 @@ let
   # ... pkgs.foo ...").
   pkgs = applyGlobalOverrides (config.packageOverrides or (pkgs: {}));
 
+  mkOverrides = pkgsOrig: overrides: overrides //
+        (lib.optionalAttrs (pkgsOrig.stdenv ? overrides && crossSystem == null) (pkgsOrig.stdenv.overrides pkgsOrig));
 
   # Return the complete set of packages, after applying the overrides
   # returned by the `overrider' function (see above).  Warning: this
@@ -110,8 +112,7 @@ let
       # in the case of cross-building, or otherwise the basic
       # overrided packages will not be built with the crossStdenv
       # adapter.
-      overrides = overrider pkgsOrig //
-        (lib.optionalAttrs (pkgsOrig.stdenv ? overrides && crossSystem == null) (pkgsOrig.stdenv.overrides pkgsOrig));
+      overrides = mkOverrides pkgsOrig (overrider pkgsOrig);
 
       # The un-overriden packages, passed to `overrider'.
       pkgsOrig = pkgsFun pkgs {};
@@ -142,6 +143,22 @@ let
 
   newScope = extra: lib.callPackageWith (defaultScope // extra);
 
+  # Easily override this package set.
+  # Warning: this function is very expensive and must not be used
+  # from within the nixpkgs repository.
+  #
+  # Example:
+  #  pkgs.overridePackages (self: super: {
+  #    foo = super.foo.override { ... };
+  #  }
+  #
+  # The result is `pkgs' where all the derivations depending on `foo'
+  # will use the new version.
+  overridePackages = f:
+    let
+      newpkgs = pkgsFun newpkgs overrides;
+      overrides = mkOverrides pkgs (f newpkgs pkgs);
+    in newpkgs;
 
   # Override system. This is useful to build i686 packages on x86_64-linux.
   forceSystem = system: kernel: (import ./all-packages.nix) {
@@ -890,7 +907,7 @@ let
   };
 
   rsyslog-light = callPackage ../tools/system/rsyslog {
-    krb5 = null;
+    libkrb5 = null;
     systemd = null;
     jemalloc = null;
     libmysql = null;
@@ -4339,8 +4356,6 @@ let
 
     mezzo = callPackage ../development/compilers/mezzo { };
 
-    mldonkey = callPackage ../applications/networking/p2p/mldonkey { };
-
     mlgmp =  callPackage ../development/ocaml-modules/mlgmp { };
 
     ocaml_batteries = callPackage ../development/ocaml-modules/batteries { };
@@ -4719,10 +4734,14 @@ let
   erlangR17_odbc = callPackage ../development/interpreters/erlang/R17.nix { odbcSupport = true; };
   erlangR17_javac = callPackage ../development/interpreters/erlang/R17.nix { javacSupport = true; };
   erlangR17_odbc_javac = callPackage ../development/interpreters/erlang/R17.nix { javacSupport = true; odbcSupport = true; };
-  erlang = erlangR17;
-  erlang_odbc = erlangR17_odbc;
-  erlang_javac = erlangR17_javac;
-  erlang_odbc_javac = erlangR17_odbc_javac;
+  erlangR18 = callPackage ../development/interpreters/erlang/R18.nix { };
+  erlangR18_odbc = callPackage ../development/interpreters/erlang/R18.nix { odbcSupport = true; };
+  erlangR18_javac = callPackage ../development/interpreters/erlang/R18.nix { javacSupport = true; };
+  erlangR18_odbc_javac = callPackage ../development/interpreters/erlang/R18.nix { javacSupport = true; odbcSupport = true; };
+  erlang = erlangR18;
+  erlang_odbc = erlangR18_odbc;
+  erlang_javac = erlangR18_javac;
+  erlang_odbc_javac = erlangR18_odbc_javac;
 
   rebar = callPackage ../development/tools/build-managers/rebar { };
 
@@ -6368,7 +6387,7 @@ let
 
   # TODO : Add MIT Kerberos and let admin choose.
   # TODO : Fix kerberos on Darwin
-  kerberos = if stdenv.isDarwin then null else heimdal;
+  kerberos = if stdenv.isDarwin then null else libheimdal;
 
   heimdal = callPackage ../development/libraries/kerberos/heimdal.nix {
     openldap = openldap.override {
@@ -6376,6 +6395,7 @@ let
     };
     cyrus_sasl = cyrus_sasl.override { kerberos = null; };
   };
+  libheimdal = heimdal;
 
   harfbuzz = callPackage ../development/libraries/harfbuzz { };
   harfbuzz-icu = callPackage ../development/libraries/harfbuzz {
@@ -6512,6 +6532,7 @@ let
     };
     inherit (darwin) bootstrap_cmds;
   };
+  libkrb5 = krb5;
 
   LASzip = callPackage ../development/libraries/LASzip { };
 
@@ -7166,7 +7187,9 @@ let
 
   libtoxcore = callPackage ../development/libraries/libtoxcore { };
 
-  libtsm = callPackage ../development/libraries/libtsm { };
+  libtsm = callPackage ../development/libraries/libtsm {
+    automake = automake114x;
+  };
 
   libtunepimp = callPackage ../development/libraries/libtunepimp { };
 
@@ -8610,7 +8633,7 @@ let
   ### SERVERS
 
   "389-ds-base" = callPackage ../servers/ldap/389 {
-    kerberos = krb5;
+    kerberos = libkrb5;
   };
 
   rdf4store = callPackage ../servers/http/4store { };
@@ -9016,7 +9039,7 @@ let
 
   samba4 = callPackage ../servers/samba/4.x.nix {
     python = python2;
-    kerberos = heimdal;
+    kerberos = null;  # Bundle kerberos because samba uses internal, non-stable functions
     gnutls = gnutls33;
     # enableLDAP
   };
@@ -9133,7 +9156,7 @@ let
 
   xwayland = with xorg; callPackage ../servers/x11/xorg/xwayland.nix { };
 
-  yaws = callPackage ../servers/http/yaws { };
+  yaws = callPackage ../servers/http/yaws { erlang = erlangR17; };
 
   zabbix = recurseIntoAttrs (import ../servers/monitoring/zabbix {
     inherit fetchurl stdenv pkgconfig postgresql curl openssl zlib;
@@ -10705,11 +10728,6 @@ let
   codeblocks = callPackage ../applications/editors/codeblocks { };
   codeblocksFull = callPackage ../applications/editors/codeblocks { contribPlugins = true; };
 
-  codeville = builderDefsPackage (import ../applications/version-management/codeville/0.8.0.nix) {
-    inherit makeWrapper;
-    python = pythonFull;
-  };
-
   comical = callPackage ../applications/graphics/comical { };
 
   conkeror = callPackage ../applications/networking/browsers/conkeror { };
@@ -11821,6 +11839,8 @@ let
 
   mjpg-streamer = callPackage ../applications/video/mjpg-streamer { };
 
+  mldonkey = callPackage ../applications/networking/p2p/mldonkey { };
+
   mmex = callPackage ../applications/office/mmex { };
 
   moc = callPackage ../applications/audio/moc { };
@@ -12034,7 +12054,9 @@ let
     inherit (gnome) libglade;
   };
 
-  obs-studio = callPackage ../applications/video/obs-studio { };
+  obs-studio = callPackage ../applications/video/obs-studio {
+    pulseaudioSupport = config.pulseaudio or false;
+  };
 
   ocrad = callPackage ../applications/graphics/ocrad { };
 
@@ -12211,6 +12233,8 @@ let
 
   qtox = callPackage ../applications/networking/instant-messengers/qtox { };
 
+  qtpass = callPackage ../applications/misc/qtpass { };
+
   qtpfsgui = callPackage ../applications/graphics/qtpfsgui { };
 
   qtractor = callPackage ../applications/audio/qtractor { };
@@ -14042,6 +14066,7 @@ let
   };
 
   coq_8_3 = callPackage ../applications/science/logic/coq/8.3.nix {
+    make = gnumake3;
     inherit (ocamlPackages_3_12_1) ocaml findlib;
     camlp5 = ocamlPackages_3_12_1.camlp5_transitional;
     lablgtk = ocamlPackages_3_12_1.lablgtk_2_14;
@@ -14111,13 +14136,7 @@ let
 
   ekrhyper = callPackage ../applications/science/logic/ekrhyper {};
 
-  eprover = callPackage ../applications/science/logic/eprover {
-    texLive = texLiveAggregationFun {
-      paths = [
-        texLive texLiveExtra
-      ];
-    };
-  };
+  eprover = callPackage ../applications/science/logic/eprover { };
 
   gappa = callPackage ../applications/science/logic/gappa { };
 
@@ -14655,7 +14674,7 @@ let
     inherit builderDefs zlib bzip2 ncurses libpng ed lesstif ruby potrace
       gd t1lib freetype icu perl expat curl xz pkgconfig zziplib texinfo
       libjpeg bison python fontconfig flex poppler libpaper graphite2
-      makeWrapper gmp mpfr xpdf;
+      makeWrapper gmp mpfr xpdf config;
     inherit (xlibs) libXaw libX11 xproto libXt libXpm
       libXmu libXext xextproto libSM libICE;
     ghostscript = ghostscriptX;
@@ -14728,6 +14747,8 @@ let
 
   utf8proc = callPackage ../development/libraries/utf8proc { };
 
+  vault = callPackage ../servers/vault {};
+
   vbam = callPackage ../misc/emulators/vbam {
     inherit (xlibs) libpthreadstubs;
   };
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 87acf28cef9..f280691555b 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -6502,6 +6502,34 @@ let
     };
   };
 
+  j2cli = buildPythonPackage rec {
+    name = "j2cli-${version}";
+    version = "0.3.1-0";
+
+    src = pkgs.fetchurl {
+      url = "https://pypi.python.org/packages/source/j/j2cli/${name}.tar.gz";
+      sha256 = "0y3w1x9935qzx8w6m2r6g4ghyjmxn33wryiif6xb56q7cj9w1433";
+    };
+
+    disabled = ! (isPy26 || isPy27);
+
+    buildInputs = [ self.nose ];
+
+    propagatedBuildInputs = with self; [ jinja2 pyyaml ];
+
+    meta = {
+      homepage = https://github.com/kolypto/j2cli;
+      description = "Jinja2 Command-Line Tool";
+      license = licenses.bsd3;
+      longDescription = ''
+        J2Cli is a command-line tool for templating in shell-scripts,
+        leveraging the Jinja2 library.
+      '';
+      platforms = platforms.all;
+      maintainers = with maintainers; [ rushmorem ];
+    };
+  };
+
   jinja2 = buildPythonPackage rec {
     name = "Jinja2-2.7.3";
 
diff --git a/pkgs/top-level/release-lib.nix b/pkgs/top-level/release-lib.nix
index 2f272ced4af..8c66964ba72 100644
--- a/pkgs/top-level/release-lib.nix
+++ b/pkgs/top-level/release-lib.nix
@@ -7,6 +7,7 @@ rec {
   # Ensure that we don't build packages marked as unfree.
   allPackages = args: packageSet (args // {
     config.allowUnfree = false;
+    config.inHydra = true;
   });
 
   pkgs = pkgsFor "x86_64-linux";