summary refs log tree commit diff
path: root/pkgs/os-specific/linux
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux')
-rw-r--r--pkgs/os-specific/linux/afuse/default.nix14
-rw-r--r--pkgs/os-specific/linux/android-udev-rules/default.nix23
-rw-r--r--pkgs/os-specific/linux/ati-drivers/default.nix2
-rw-r--r--pkgs/os-specific/linux/batman-adv/alfred.nix27
-rw-r--r--pkgs/os-specific/linux/batman-adv/batctl.nix4
-rw-r--r--pkgs/os-specific/linux/batman-adv/default.nix6
-rw-r--r--pkgs/os-specific/linux/cifs-utils/default.nix11
-rw-r--r--pkgs/os-specific/linux/consoletools/default.nix14
-rw-r--r--pkgs/os-specific/linux/dmtcp/default.nix22
-rw-r--r--pkgs/os-specific/linux/firejail/default.nix8
-rw-r--r--pkgs/os-specific/linux/firmware/iwlegacy/default.nix2
-rw-r--r--pkgs/os-specific/linux/firmware/iwlwifi/default.nix9
-rw-r--r--pkgs/os-specific/linux/firmware/zd1211/default.nix4
-rw-r--r--pkgs/os-specific/linux/flashbench/default.nix27
-rw-r--r--pkgs/os-specific/linux/freefall/default.nix42
-rw-r--r--pkgs/os-specific/linux/iproute/default.nix11
-rw-r--r--pkgs/os-specific/linux/jfbview/default.nix44
-rw-r--r--pkgs/os-specific/linux/kernel/bridge-stp-helper.patch13
-rw-r--r--pkgs/os-specific/linux/kernel/common-config.nix7
-rw-r--r--pkgs/os-specific/linux/kernel/generic.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.10.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.12.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.14.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.16.nix17
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.17.nix17
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.18.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.2.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-3.4.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-testing.nix8
-rw-r--r--pkgs/os-specific/linux/kernel/patches.nix17
-rw-r--r--pkgs/os-specific/linux/libcap/progs.nix8
-rw-r--r--pkgs/os-specific/linux/lxc/default.nix4
-rw-r--r--pkgs/os-specific/linux/mstpd/default.nix24
-rw-r--r--pkgs/os-specific/linux/mstpd/fixes.patch72
-rw-r--r--pkgs/os-specific/linux/nfs-utils/default.nix41
-rw-r--r--pkgs/os-specific/linux/nfs-utils/no-install.patch19
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/default.nix4
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/legacy173.nix2
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/legacy304.nix2
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/legacy340.nix4
-rw-r--r--pkgs/os-specific/linux/ocz-toolbox/default.nix2
-rw-r--r--pkgs/os-specific/linux/opengl/xorg-sys/default.nix2
-rw-r--r--pkgs/os-specific/linux/pam_krb5/default.nix8
-rw-r--r--pkgs/os-specific/linux/pcmciautils/default.nix8
-rw-r--r--pkgs/os-specific/linux/prl-tools/default.nix2
-rw-r--r--pkgs/os-specific/linux/radeontop/default.nix38
-rw-r--r--pkgs/os-specific/linux/sdparm/default.nix11
-rw-r--r--pkgs/os-specific/linux/spl/default.nix43
-rw-r--r--pkgs/os-specific/linux/spl/generic.nix61
-rw-r--r--pkgs/os-specific/linux/spl/git.nix49
-rw-r--r--pkgs/os-specific/linux/spl/install_prefix-git.patch173
-rw-r--r--pkgs/os-specific/linux/spl/kernel-3.16.patch34
-rw-r--r--pkgs/os-specific/linux/spl/kernel-3.17.patch175
-rw-r--r--pkgs/os-specific/linux/spl/time.patch18
-rw-r--r--pkgs/os-specific/linux/sysdig/default.nix4
-rw-r--r--pkgs/os-specific/linux/systemd/default.nix2
-rw-r--r--pkgs/os-specific/linux/util-linux/default.nix10
-rw-r--r--pkgs/os-specific/linux/util-linux/rtcwake-search-PATH-for-shutdown.patch30
-rw-r--r--pkgs/os-specific/linux/xf86-input-wacom/default.nix4
-rw-r--r--pkgs/os-specific/linux/zfs/3.19-compat-git.patch146
-rw-r--r--pkgs/os-specific/linux/zfs/bc151f7b312dea09c6ec5b9a320e65140789643a.patch84
-rw-r--r--pkgs/os-specific/linux/zfs/default.nix67
-rw-r--r--pkgs/os-specific/linux/zfs/generic.nix94
-rw-r--r--pkgs/os-specific/linux/zfs/git.nix75
-rw-r--r--pkgs/os-specific/linux/zfs/nix-build-git.patch133
-rw-r--r--pkgs/os-specific/linux/zfs/remove-lock-checks.patch64
66 files changed, 1169 insertions, 725 deletions
diff --git a/pkgs/os-specific/linux/afuse/default.nix b/pkgs/os-specific/linux/afuse/default.nix
index 70c8f36105c7..4cf533110705 100644
--- a/pkgs/os-specific/linux/afuse/default.nix
+++ b/pkgs/os-specific/linux/afuse/default.nix
@@ -1,18 +1,18 @@
-{ stdenv, fetchurl, pkgconfig, fuse }:
+{ stdenv, fetchurl, pkgconfig, autoreconfHook, fuse }:
 
 stdenv.mkDerivation {
-  name = "afuse-0.2";
+  name = "afuse-0.4.1";
 
   src = fetchurl {
-    url = mirror://sourceforge/afuse/0.2/afuse-0.2.tar.gz;
-    sha256 = "1lj2jdks0bgwxbjqp5a9f7qdry19kar6pg7dh1ml98gapx9siylj";
+    url = https://github.com/pcarrier/afuse/archive/v0.4.1.tar.gz;
+    sha256 = "1sfhicmxppkvdd4z9klfn63snb71gr9hff6xij1gzk94xg6m0ycc";
   };
 
-  buildInputs = [ pkgconfig fuse ];
+  buildInputs = [ autoreconfHook pkgconfig fuse ];
 
-  meta = { 
+  meta = {
     description = "Automounter in userspace";
-    homepage = http://sourceforge.net/projects/afuse;
+    homepage = https://github.com/pcarrier/afuse;
     license = stdenv.lib.licenses.gpl2;
     maintainers = [ stdenv.lib.maintainers.marcweber ];
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/os-specific/linux/android-udev-rules/default.nix b/pkgs/os-specific/linux/android-udev-rules/default.nix
new file mode 100644
index 000000000000..534ba9970043
--- /dev/null
+++ b/pkgs/os-specific/linux/android-udev-rules/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchgit }:
+
+stdenv.mkDerivation {
+  name = "android-udev-rules";
+
+  src = fetchgit {
+    url = "git://github.com/M0Rf30/android-udev-rules";
+    rev = "82f78561f388363a925e6663211988d9527de0c6";
+    sha256 = "badd7a152acf92c75335917c07125ffb1b5fda0bed5ec1e474d76e48a8d9f0db";
+  };
+
+  installPhase = ''
+    install -D 51-android.rules $out/lib/udev/rules.d/51-android.rules
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/M0Rf30/android-udev-rules;
+    description = "Android udev rules list aimed to be the most comprehensive on the net";
+    platforms = platforms.linux;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/pkgs/os-specific/linux/ati-drivers/default.nix b/pkgs/os-specific/linux/ati-drivers/default.nix
index 4f64b1358324..179166bbc79a 100644
--- a/pkgs/os-specific/linux/ati-drivers/default.nix
+++ b/pkgs/os-specific/linux/ati-drivers/default.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation {
   builder = ./builder.sh;
 
   inherit libXxf86vm xf86vidmodeproto;
-  gcc = stdenv.cc.gcc;
+  gcc = stdenv.cc.cc;
 
   src = fetchurl {
     url = http://www2.ati.com/drivers/linux/amd-catalyst-omega-14.12-linux-run-installers.zip;
diff --git a/pkgs/os-specific/linux/batman-adv/alfred.nix b/pkgs/os-specific/linux/batman-adv/alfred.nix
new file mode 100644
index 000000000000..2d9f5079586c
--- /dev/null
+++ b/pkgs/os-specific/linux/batman-adv/alfred.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, pkgconfig, gpsd }:
+
+let
+  ver = "2014.4.0";
+in
+stdenv.mkDerivation rec {
+  name = "alfred-${ver}";
+
+  src = fetchurl {
+    url = "http://downloads.open-mesh.org/batman/releases/batman-adv-${ver}/${name}.tar.gz";
+    sha256 = "99e6c64e7069b0b7cb861369d5c198bfc7d74d41509b8edd8a17ba78e7c8d034";
+  };
+
+  buildInputs = [ pkgconfig gpsd ];
+
+  preBuild = ''
+    makeFlags="PREFIX=$out PKG_CONFIG=${pkgconfig}/bin/pkg-config"
+  '';
+
+  meta = {
+    homepage = http://www.open-mesh.org/projects/batman-adv/wiki/Wiki;
+    description = "B.A.T.M.A.N. routing protocol in a linux kernel module for layer 2, information distribution tool";
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [ fpletz ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/os-specific/linux/batman-adv/batctl.nix b/pkgs/os-specific/linux/batman-adv/batctl.nix
index 6e57e7651c45..5ac3e6b4117f 100644
--- a/pkgs/os-specific/linux/batman-adv/batctl.nix
+++ b/pkgs/os-specific/linux/batman-adv/batctl.nix
@@ -1,14 +1,14 @@
 {stdenv, fetchurl}:
 
 let
-  ver = "2013.4.0";
+  ver = "2014.4.0";
 in
 stdenv.mkDerivation rec {
   name = "batctl-${ver}";
 
   src = fetchurl {
     url = "http://downloads.open-mesh.org/batman/releases/batman-adv-${ver}/${name}.tar.gz";
-    sha256 = "0k6b695h38m92a8wn5gvb3z746m3fm0ygv58yyn163adcsvf7sjd";
+    sha256 = "4deae3b6664d0d13acf7a8ece74175a31a72fe58fb15cb9112a9a2014b32cb4c";
   };
 
   preBuild = ''
diff --git a/pkgs/os-specific/linux/batman-adv/default.nix b/pkgs/os-specific/linux/batman-adv/default.nix
index 8407f270f484..341b6f3af1d5 100644
--- a/pkgs/os-specific/linux/batman-adv/default.nix
+++ b/pkgs/os-specific/linux/batman-adv/default.nix
@@ -2,14 +2,14 @@
 
 assert stdenv.lib.versionOlder kernel.version "3.17";
 
-let base = "batman-adv-2014.3.0"; in
+let base = "batman-adv-2014.4.0"; in
 
 stdenv.mkDerivation rec {
   name = "${base}-${kernel.version}";
 
   src = fetchurl {
     url = "http://downloads.open-mesh.org/batman/releases/${base}/${base}.tar.gz";
-    sha1 = "wh3if8v4wfwskvzwqsjsyr929krzfmsx";
+    sha256 = "757b9ddd346680f6fd87dc28fde6da0ddc0423a65fbc88fdbaa7b247fed2c1a8";
   };
 
   preBuild = ''
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     homepage = http://www.open-mesh.org/projects/batman-adv/wiki/Wiki;
     description = "B.A.T.M.A.N. routing protocol in a linux kernel module for layer 2";
     license = stdenv.lib.licenses.gpl2;
-    maintainers = with stdenv.lib.maintainers; [viric];
+    maintainers = with stdenv.lib.maintainers; [ viric fpletz ];
     platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/os-specific/linux/cifs-utils/default.nix b/pkgs/os-specific/linux/cifs-utils/default.nix
index 0183a606b2e1..46a927209a23 100644
--- a/pkgs/os-specific/linux/cifs-utils/default.nix
+++ b/pkgs/os-specific/linux/cifs-utils/default.nix
@@ -1,18 +1,21 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, kerberos, keyutils, pam }:
 
 stdenv.mkDerivation rec {
   name = "cifs-utils-6.4";
 
   src = fetchurl {
-    url = "ftp://ftp.samba.org/pub/linux-cifs/cifs-utils/${name}.tar.bz2";
+    url = "mirror://samba/pub/linux-cifs/cifs-utils/${name}.tar.bz2";
     sha256 = "1qz6d2xg4z1if0hy7qwyzgcr59l0alkhci6gxgjdldglda967z1q";
   };
 
+  buildInputs = [ kerberos keyutils pam ];
+
   makeFlags = "root_sbindir=$(out)/sbin";
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://www.samba.org/linux-cifs/cifs-utils/;
     description = "Tools for managing Linux CIFS client filesystems";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
+    license = licenses.lgpl3;
   };
 }
diff --git a/pkgs/os-specific/linux/consoletools/default.nix b/pkgs/os-specific/linux/consoletools/default.nix
index 83c694972e60..6961768e7d32 100644
--- a/pkgs/os-specific/linux/consoletools/default.nix
+++ b/pkgs/os-specific/linux/consoletools/default.nix
@@ -2,20 +2,22 @@
 
 stdenv.mkDerivation rec {
   name = "linuxconsoletools-${version}";
-  version = "1.4.7";
+  version = "1.4.8";
 
   src = fetchurl {
     url = "mirror://sourceforge/linuxconsole/${name}.tar.bz2";
-    sha256 = "1wgcmmjiqw3hh36jzvhgq07kq13ar2miafz02xshds2b0kdcz4s4";
+    sha256 = "0spf9hx48cqx2i46pkz0gbrn7xrk68cw8iyrfbs2b3k0bxcsri13";
   };
 
   buildInputs = [ SDL ];
-  makeFlags = [ "PREFIX=$(out)" ];
+  makeFlags = [ "DESTDIR=$(out)"];
 
-  meta = {
-    homepage = "https://sourceforge.net/projects/linuxconsole/";
+  meta = with stdenv.lib; {
+    homepage = https://sourceforge.net/projects/linuxconsole/;
     description = "A set of tools for joysticks and serial peripherals";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ pSub ];
 
     longDescription = ''
       The included tools are:
diff --git a/pkgs/os-specific/linux/dmtcp/default.nix b/pkgs/os-specific/linux/dmtcp/default.nix
index c863be14461c..fea41affe2c4 100644
--- a/pkgs/os-specific/linux/dmtcp/default.nix
+++ b/pkgs/os-specific/linux/dmtcp/default.nix
@@ -4,28 +4,30 @@
 stdenv.mkDerivation rec {
   name = "dmtcp-${version}";
 
-  version = "1.2.0";
+  version = "2.3.1";
 
   buildInputs = [ perl python ];
 
   src = fetchurl {
-    url = "mirror://sourceforge/dmtcp/dmtcp_${version}.tar.gz";
-    sha256 = "1pw3m4l1xf887xagd0yrrnb35s372j0kvjziyy3gmx9fxpga1jzb";
+    url = "mirror://sourceforge/dmtcp/dmtcp-${version}.tar.gz";
+    sha256 = "1f83ae112e102d4fbf69dded0dfaa6daeb60c4c0c569297553785a876e95ba15";
   };
 
   preConfigure = ''
-    substituteInPlace dmtcp/src/dmtcp_coordinator.cpp \
-      --replace /bin/bash /bin/sh
-    substituteInPlace utils/gdb-add-symbol-file \
-      --replace /bin/bash /bin/sh
+    substituteInPlace src/dmtcp_coordinator.cpp \
+      --replace /bin/bash ${stdenv.shell}
+    substituteInPlace util/gdb-add-symbol-file \
+      --replace /bin/bash ${stdenv.shell}
     substituteInPlace test/autotest.py \
       --replace /usr/bin/env $(type -p env) \
       --replace /bin/bash $(type -p bash) \
       --replace /usr/bin/perl $(type -p perl) \
-      --replace /usr/bin/python $(type -p python)
+      --replace /usr/bin/python $(type -p python) \
+      --replace "os.environ['USER']" "\"nixbld1\"" \
+      --replace "os.getenv('USER')" "\"nixbld1\""
   '';
 
-  doCheck = true;
+  doCheck = false;
 
   meta = {
     description = "Distributed MultiThreaded Checkpointing";
@@ -36,6 +38,6 @@ stdenv.mkDerivation rec {
       not modify the user's program or the operating system.
     '';
     homepage = http://dmtcp.sourceforge.net/;
-    license = "LGPL";
+    license = stdenv.lib.licenses.lgpl3Plus; # most files seem this or LGPL-2.1+
   };
 }
diff --git a/pkgs/os-specific/linux/firejail/default.nix b/pkgs/os-specific/linux/firejail/default.nix
index 9f3397fc8efd..c2d95c3d5354 100644
--- a/pkgs/os-specific/linux/firejail/default.nix
+++ b/pkgs/os-specific/linux/firejail/default.nix
@@ -3,11 +3,11 @@ let
   s = # Generated upstream information
   rec {
     baseName="firejail";
-    version="0.9.18";
+    version="0.9.20";
     name="${baseName}-${version}";
-    hash="0qsjbnx9xzvzcbq7wdcf51v5abi4ml9jsai7w6xmns51qx4325a2";
-    url="mirror://sourceforge/project/firejail/firejail/firejail-0.9.18-rc1.tar.bz2";
-    sha256="0qsjbnx9xzvzcbq7wdcf51v5abi4ml9jsai7w6xmns51qx4325a2";
+    hash="1sjahmpjd6zmn27xp5xl683xm3353rp3094sgl2brq6477ffbi6y";
+    url="mirror://sourceforge/project/firejail/firejail/firejail-0.9.20-rc1.tar.bz2";
+    sha256="1sjahmpjd6zmn27xp5xl683xm3353rp3094sgl2brq6477ffbi6y";
   };
   buildInputs = [
   ];
diff --git a/pkgs/os-specific/linux/firmware/iwlegacy/default.nix b/pkgs/os-specific/linux/firmware/iwlegacy/default.nix
index 48472c96659c..99524e4504e9 100644
--- a/pkgs/os-specific/linux/firmware/iwlegacy/default.nix
+++ b/pkgs/os-specific/linux/firmware/iwlegacy/default.nix
@@ -12,7 +12,7 @@ let
   fetchPackage =
     { name, sha256 }: fetchurl {
       name = "iwlwifi-${name}.tgz";
-      url = "http://wireless.kernel.org/en/users/Drivers/iwlegacy?action=AttachFile&do=get&target=iwlwifi-${name}.tgz";
+      url = "https://wireless.wiki.kernel.org/_media/en/users/drivers/iwlwifi-${name}.tgz";
       inherit sha256;
     };
 
diff --git a/pkgs/os-specific/linux/firmware/iwlwifi/default.nix b/pkgs/os-specific/linux/firmware/iwlwifi/default.nix
index f6df3bb50f42..a0236fc3c996 100644
--- a/pkgs/os-specific/linux/firmware/iwlwifi/default.nix
+++ b/pkgs/os-specific/linux/firmware/iwlwifi/default.nix
@@ -39,16 +39,15 @@ let
     { name = "7265-ucode-25.228.9.0"; sha256 = "1dv9bai1s6vdigsahbrxjwlndnp2dsgkqz8j7021d34s99kbi6z8"; }
 
     # Kernel 3.17+
-    { name = "7260-ucode-23.10.10.0"; sha256 = "0n8blgwj3765zyripgbawbi3h97qyficdv72mmzf8hznk30p6kxg"; }
-    { name = "3160-ucode-23.10.10.0"; sha256 = "0332j710495980avzvhjixnr6f4f8v0srpnqn05x1q0c9sw6n7pp"; }
-    # Bad archive, assumed a problem with the served blob
-    #{ name = "7265-ucode-23.10.10.0"; sha256 = "1v2q9b3dah1p4mnmvv1blvi9awjcbiafmjyll5hi1hr6p28xwhva"; }
+    { name = "7260-ucode-23.11.10.0"; sha256 = "1d9w7kd3h3632qmwb44943lxdafjn3ii8ha9wdvqri3b8fjfn7sa"; }
+    { name = "3160-ucode-23.11.10.0"; sha256 = "0ijpgfzz8735rsbkc6mvk3w7f1v9rr9dgy1l79vzmzc1vh2zpbdm"; }
+    { name = "7265-ucode-23.11.10.0"; sha256 = "1az8nq6z1ns1220309wp8jq1sc5flz2ac5k41pgj50503h54rlvi"; }
   ];
 
   fetchPackage =
     { name, sha256 }: fetchurl {
       name = "iwlwifi-${name}.tgz";
-      url = "http://wireless.kernel.org/en/users/Drivers/iwlwifi?action=AttachFile&do=get&target=iwlwifi-${name}.tgz";
+      url = "https://wireless.wiki.kernel.org/_media/en/users/drivers/iwlwifi-${name}.tgz";
       inherit sha256;
     };
 
diff --git a/pkgs/os-specific/linux/firmware/zd1211/default.nix b/pkgs/os-specific/linux/firmware/zd1211/default.nix
index cb4466dc20f4..96e534e3b805 100644
--- a/pkgs/os-specific/linux/firmware/zd1211/default.nix
+++ b/pkgs/os-specific/linux/firmware/zd1211/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "zd1211-firmware";
-  version = "1.4";
+  version = "1.5";
 
   name = "${pname}-${version}";
   
   src = fetchurl {
     url = "mirror://sourceforge/zd1211/${name}.tar.bz2";
-    sha256 = "866308f6f59f7075f075d4959dff2ede47735c751251fecd1496df1ba4d338e1";
+    sha256 = "04ibs0qw8bh6h6zmm5iz6lddgknwhsjq8ib3gyck6a7psw83h7gi";
   };
   
   buildPhase = "true";
diff --git a/pkgs/os-specific/linux/flashbench/default.nix b/pkgs/os-specific/linux/flashbench/default.nix
new file mode 100644
index 000000000000..0a6364f07df5
--- /dev/null
+++ b/pkgs/os-specific/linux/flashbench/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchgit }:
+
+stdenv.mkDerivation rec {
+  name = "flashbench-${version}";
+  version = "2012-06-06";
+
+  src = fetchgit {
+    url = "https://github.com/bradfa/flashbench.git";
+    rev = "2e30b1968a66147412f21002ea844122a0d5e2f0";
+    sha256 = "037rhd2alwfip9qk78cy8fwwnc2kdyzccsyc7v2zpmvl4vvpvnhg";
+  };
+
+  installPhase = ''
+    install -d -m755 $out/bin $out/share/doc/flashbench
+    install -v -m755 flashbench $out/bin
+    install -v -m755 erase $out/bin/flashbench-erase
+    install -v -m644 README $out/share/doc/flashbench
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Testing tool for flash based memory devices";
+    homepage = https://github.com/bradfa/flashbench;
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+    maintainers = [ maintainers.rycee ];
+  };
+}
diff --git a/pkgs/os-specific/linux/freefall/default.nix b/pkgs/os-specific/linux/freefall/default.nix
new file mode 100644
index 000000000000..9903cb5b963d
--- /dev/null
+++ b/pkgs/os-specific/linux/freefall/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "3.18.3";
+  name = "freefall-${version}";
+
+  src = fetchurl {
+    url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
+    sha256 = "0ma2x68975xsi9kb15p0615nx9sm5ppb309kfdz7fgx9pg84q0hf";
+  };
+
+  buildPhase = ''
+    cd Documentation/laptops
+
+    # Default time-out is a little low, probably because the AC/lid status
+    # functions were never implemented. Because no-one still uses HDDs, right?
+    substituteInPlace freefall.c --replace "alarm(2)" "alarm(5)"
+
+    cc -o freefall freefall.c
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    install freefall $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Free-fall protection for spinning HP/Dell laptop hard drives";
+    longDescription = ''
+      ATA/ATAPI-7 specifies the IDLE IMMEDIATE command with unload feature.
+      Issuing this command should cause the drive to switch to idle mode and
+      unload disk heads. This feature is being used in modern laptops in
+      conjunction with accelerometers and appropriate software to implement
+      a shock protection facility. The idea is to stop all I/O operations on
+      the internal hard drive and park its heads on the ramp when critical
+      situations are anticipated. This has no effect on SSD devices!
+    '';
+    license = with licenses; gpl2;
+    platforms = with platforms; linux;
+    maintainers = with maintainers; [ nckx ];
+  };
+}
diff --git a/pkgs/os-specific/linux/iproute/default.nix b/pkgs/os-specific/linux/iproute/default.nix
index d6b3231ec460..6cfde916815a 100644
--- a/pkgs/os-specific/linux/iproute/default.nix
+++ b/pkgs/os-specific/linux/iproute/default.nix
@@ -1,12 +1,11 @@
-{ fetchgit, stdenv, flex, bison, db, iptables, pkgconfig }:
+{ fetchurl, stdenv, flex, bison, db, iptables, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "iproute2-3.17.0";
+  name = "iproute2-3.18.0";
 
-  src = fetchgit {
-    url = "git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/iproute2.git";
-    rev = "refs/tags/v3.17.0";
-    sha256 = "113ayyy7cjxn0bf67fh4is4z0jysgif016kv7ig0jp6r68xp2spa";
+  src = fetchurl {
+    url = "mirror://kernel/linux/utils/net/iproute2/${name}.tar.xz";
+    sha256 = "1pzipx6m27rv42b76isik5amziijb88lj5kxvyqlj1xx98aq58fm";
   };
 
   patch = [ ./vpnc.patch ];
diff --git a/pkgs/os-specific/linux/jfbview/default.nix b/pkgs/os-specific/linux/jfbview/default.nix
new file mode 100644
index 000000000000..b497784861f4
--- /dev/null
+++ b/pkgs/os-specific/linux/jfbview/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, fetchFromGitHub, freetype, imlib2, jbig2dec, libjpeg, libX11, mujs
+, mupdf, ncurses, openjpeg, openssl }:
+
+stdenv.mkDerivation rec {
+  version = "0.4.2"; # TODO: update to 0.5 or later when nixpkgs has caught up
+  name = "jfbview-${version}";
+
+  src = fetchFromGitHub {
+    repo = "JFBView";
+    owner = "jichu4n";
+    rev = version;
+    sha256 = "1hhlzvs0jhygd3mqpzg5zymrbay9c8ilc4wjnwg00lvxhv3rwswr";
+  };
+
+  buildInputs = [ freetype imlib2 jbig2dec libjpeg libX11 mujs mupdf ncurses
+    openjpeg openssl ];
+
+  enableParallelBuilding = true;
+
+  makeFlags = "jfbpdf jfbview";
+
+  installPhase = ''
+    mkdir -p $out/bin
+    install jfbpdf jfbview $out/bin
+  '';
+
+  meta = with stdenv.lib; {
+    description = "PDF and image viewer for the Linux framebuffer";
+    longDescription = ''
+      PDF and image viewer for the Linux framebuffer. Very fast with a number
+      of advanced and unique features including:
+      - Reads PDFs (MuPDF) and common image formats (Imlib2).
+      - Supports arbitrary zoom (10% - 1000%) and rotation.
+      - Table of Contents (TOC) viewer for PDF documents.
+      - Multi-threaded rendering on multi-core machines.
+      - Asynchronous background rendering of the next page.
+      - Customizable multi-threaded caching.
+    '';
+    homepage = http://seasonofcode.com/pages/jfbview.html;
+    license = with licenses; asl20;
+    platforms = with platforms; linux;
+    maintainers = with maintainers; [ nckx ];
+  };
+}
diff --git a/pkgs/os-specific/linux/kernel/bridge-stp-helper.patch b/pkgs/os-specific/linux/kernel/bridge-stp-helper.patch
new file mode 100644
index 000000000000..70d0f944c2a0
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel/bridge-stp-helper.patch
@@ -0,0 +1,13 @@
+diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
+index aea3d13..8fcbf81 100644
+--- a/net/bridge/br_private.h
++++ b/net/bridge/br_private.h
+@@ -39,7 +39,7 @@
+ #define BR_GROUPFWD_8021AD	0xB801u
+ 
+ /* Path to usermode spanning tree program */
+-#define BR_STP_PROG	"/sbin/bridge-stp"
++#define BR_STP_PROG	"/run/current-system/sw/bin/bridge-stp"
+ 
+ typedef struct bridge_id bridge_id;
+ typedef struct mac_addr mac_addr;
diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix
index 48493044065c..4f08e5a6fd81 100644
--- a/pkgs/os-specific/linux/kernel/common-config.nix
+++ b/pkgs/os-specific/linux/kernel/common-config.nix
@@ -6,7 +6,12 @@ with stdenv.lib;
   # Power management and debugging.
   DEBUG_KERNEL y
   PM_ADVANCED_DEBUG y
-  PM_RUNTIME y
+  ${optionalString (versionOlder version "3.19") ''
+    PM_RUNTIME y
+  ''}
+  ${optionalString (versionAtLeast version "3.10") ''
+    X86_INTEL_PSTATE y
+  ''}
   TIMER_STATS y
   ${optionalString (versionOlder version "3.10") ''
     USB_SUSPEND y
diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix
index 13250e45494f..b42892f9f2d8 100644
--- a/pkgs/os-specific/linux/kernel/generic.nix
+++ b/pkgs/os-specific/linux/kernel/generic.nix
@@ -57,6 +57,10 @@ let
     autoModules = stdenv.platform.kernelAutoModules;
     arch = stdenv.platform.kernelArch;
 
+    preConfigure = ''
+        buildFlagsArray+=("KBUILD_BUILD_TIMESTAMP=Thu Jan 1 00:00:01 UTC 1970")
+    '';
+
     crossAttrs = let
         cp = stdenv.cross.platform;
       in {
diff --git a/pkgs/os-specific/linux/kernel/linux-3.10.nix b/pkgs/os-specific/linux/kernel/linux-3.10.nix
index 80143bb49050..5a27d289417f 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.10.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.10.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.10.63";
+  version = "3.10.68";
   extraMeta.branch = "3.10";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "0ajgw7xr4ilbssr9lcs4078584kr5nlycc3gc28ywc29z7vi8sjm";
+    sha256 = "13r8xd1qv2cmzk9dzh6xzy0sr4yf301a959lnf7v7ji3bs7gzp4a";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.12.nix b/pkgs/os-specific/linux/kernel/linux-3.12.nix
index 1dd49edf6d78..acfe74828e72 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.12.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.12.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.12.35";
+  version = "3.12.37";
   extraMeta.branch = "3.12";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "1krzd21hi93kwmffaxfbmyh8cbxl6afgma3yk14xm5ff5z0nlaxy";
+    sha256 = "0p7d6qdk7327yzfxzlxbxizrf7dm8vxbc3spm2ai4q278wxbi8jx";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.14.nix b/pkgs/os-specific/linux/kernel/linux-3.14.nix
index 7d4c741193f9..30af9e562e6d 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.14.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.14.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.14.27";
+  version = "3.14.32";
   # Remember to update grsecurity!
   extraMeta.branch = "3.14";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "09fxykm280zy3jq2zak6qiglsgv4756ryqwmx23hl014rk8bzszn";
+    sha256 = "1dmmb8z641ak5fsm3al5j6ifh77dvm94npwhvwmr0wp6z8k76w02";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.16.nix b/pkgs/os-specific/linux/kernel/linux-3.16.nix
deleted file mode 100644
index 6997d51a0f1a..000000000000
--- a/pkgs/os-specific/linux/kernel/linux-3.16.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{ stdenv, fetchurl, ... } @ args:
-
-import ./generic.nix (args // rec {
-  version = "3.16.7";
-  extraMeta.branch = "3.16";
-
-  src = fetchurl {
-    url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "0vm3ahw6wzq72z6jim05pcj9gzjw8jc4r1dr5wnfl810nib89pbk";
-  };
-
-  features.iwlwifi = true;
-  features.efiBootStub = true;
-  features.needsCifsUtils = true;
-  features.canDisableNetfilterConntrackHelpers = true;
-  features.netfilterRPFilter = true;
-} // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-3.17.nix b/pkgs/os-specific/linux/kernel/linux-3.17.nix
deleted file mode 100644
index a459e33f4d66..000000000000
--- a/pkgs/os-specific/linux/kernel/linux-3.17.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{ stdenv, fetchurl, ... } @ args:
-
-import ./generic.nix (args // rec {
-  version = "3.17.7";
-  extraMeta.branch = "3.17";
-
-  src = fetchurl {
-    url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "074f56sz22wqnn21gamwf63llhsqc2hgb7dzkbkd5gqjx6pfdj53";
-  };
-
-  features.iwlwifi = true;
-  features.efiBootStub = true;
-  features.needsCifsUtils = true;
-  features.canDisableNetfilterConntrackHelpers = true;
-  features.netfilterRPFilter = true;
-} // (args.argsOverride or {}))
diff --git a/pkgs/os-specific/linux/kernel/linux-3.18.nix b/pkgs/os-specific/linux/kernel/linux-3.18.nix
index e12588e052ba..73c17f6c1ca3 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.18.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.18.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.18.1";
+  version = "3.18.6";
   # Remember to update grsecurity!
   extraMeta.branch = "3.18";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "13m0s2m0zg304w86yvcmxgbjl41c4kc420044avi8rnr1xwcscsq";
+    sha256 = "1xaky9yqkpa63936z7h4x3pxp4z45jwhslxpg4nmgakk262a9hf4";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/linux-3.2.nix b/pkgs/os-specific/linux/kernel/linux-3.2.nix
index 330b643e46a2..994d14ecae58 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.2.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.2.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.2.65";
+  version = "3.2.66";
   extraMeta.branch = "3.2";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "1j9ibivhrkav5dfb7pv5m2j2y4577nqxp63npcpmna7wp7y132wm";
+    sha256 = "09l0rfv10c5kzlgfhi339ly496f6j9ichq3arpvkb3fivjkxcm45";
   };
 
   # We don't provide these patches if grsecurity is enabled, because
diff --git a/pkgs/os-specific/linux/kernel/linux-3.4.nix b/pkgs/os-specific/linux/kernel/linux-3.4.nix
index d4da722f6c2b..2d0530237210 100644
--- a/pkgs/os-specific/linux/kernel/linux-3.4.nix
+++ b/pkgs/os-specific/linux/kernel/linux-3.4.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.4.105";
+  version = "3.4.106";
   extraMeta.branch = "3.4";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/linux-${version}.tar.xz";
-    sha256 = "0xhwdkpcmvbvk1rq0mz2f2pmh322flly7wr66wdd5bypfvanrk23";
+    sha256 = "1l1k2kmlz0j12ly63w3mhvdzp5fpc22ajda4kw66fyjx96npm8sc";
   };
 
   kernelPatches = args.kernelPatches ++
diff --git a/pkgs/os-specific/linux/kernel/linux-testing.nix b/pkgs/os-specific/linux/kernel/linux-testing.nix
index 69cefcda698f..d9d16f9ac770 100644
--- a/pkgs/os-specific/linux/kernel/linux-testing.nix
+++ b/pkgs/os-specific/linux/kernel/linux-testing.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "3.18-rc7";
-  modDirVersion = "3.18.0-rc7";
-  extraMeta.branch = "3.18";
+  version = "3.19-rc7";
+  modDirVersion = "3.19.0-rc7";
+  extraMeta.branch = "3.19";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v3.x/testing/linux-${version}.tar.xz";
-    sha256 = "1zq7jd33jq4ibvjdsj8cm4zlgjag7j8r7w7ajmzivr7npdb9fvvk";
+    sha256 = "007xjngbyvdx127rkrzxs23kxcw2z54gzad9954iwhphqw0kpq9x";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix
index 8c707c7e570d..6c8047ab1d4c 100644
--- a/pkgs/os-specific/linux/kernel/patches.nix
+++ b/pkgs/os-specific/linux/kernel/patches.nix
@@ -32,6 +32,11 @@ in
 
 rec {
 
+  bridge_stp_helper =
+    { name = "bridge-stp-helper";
+      patch = ./bridge-stp-helper.patch;
+    };
+
   no_xsave =
     { name = "no-xsave";
       patch = ./no-xsave.patch;
@@ -60,17 +65,17 @@ rec {
   };
 
   grsecurity_stable = grsecPatch
-    { kversion  = "3.14.27";
-      revision  = "201412280859";
+    { kversion  = "3.14.32";
+      revision  = "201502062101";
       branch    = "stable";
-      sha256    = "185sq4bsgwmpq9g0g5fhm69ba875xhxha2rs0cn6n647v90rxrjk";
+      sha256    = "1qni3x6kwrhgqbhwm02m9wnmz7y2ydwwxw9ckk06xyq3j9qgv3aj";
     };
 
   grsecurity_unstable = grsecPatch
-    { kversion  = "3.18.1";
-      revision  = "201412281149";
+    { kversion  = "3.18.6";
+      revision  = "201502062100";
       branch    = "test";
-      sha256    = "10pq6lslfn6ck7pm1651s6pd5mqmjxvqv3iv70qrpwwb2gdhpdin";
+      sha256    = "11cy7qqkahd323hmi67r4psgryapk1qwamm9m15rhbfqgq428306";
     };
 
   grsec_fix_path =
diff --git a/pkgs/os-specific/linux/libcap/progs.nix b/pkgs/os-specific/linux/libcap/progs.nix
index 1902b4acb1a4..ae4446c82e6c 100644
--- a/pkgs/os-specific/linux/libcap/progs.nix
+++ b/pkgs/os-specific/linux/libcap/progs.nix
@@ -9,6 +9,14 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libcap ];
 
+  prePatch = ''
+    # use relative bash path
+    substituteInPlace progs/capsh.c --replace "/bin/bash" "bash"
+
+    # ensure capsh can find bash in $PATH
+    substituteInPlace progs/capsh.c --replace execve execvpe
+  '';
+
   preConfigure = "cd progs";
 
   installFlags = "RAISE_SETFCAP=no";
diff --git a/pkgs/os-specific/linux/lxc/default.nix b/pkgs/os-specific/linux/lxc/default.nix
index 79e65fdb613d..04ca4514a0f4 100644
--- a/pkgs/os-specific/linux/lxc/default.nix
+++ b/pkgs/os-specific/linux/lxc/default.nix
@@ -3,11 +3,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "lxc-1.0.6";
+  name = "lxc-1.0.7";
 
   src = fetchurl {
     url = "http://github.com/lxc/lxc/archive/${name}.tar.gz";
-    sha256 = "075i5h136b3dnf8nk6mpailz6i18yv1zcsj0jdpr9kg2i6d1ksia";
+    sha256 = "1wm8n1b8j3x37757h2yyz53k3b6r2r301fmkviqf4xp0jaav1cd0";
   };
 
   buildInputs = [ libcap apparmor perl docbook2x gnutls autoreconfHook pkgconfig ];
diff --git a/pkgs/os-specific/linux/mstpd/default.nix b/pkgs/os-specific/linux/mstpd/default.nix
new file mode 100644
index 000000000000..374300db460a
--- /dev/null
+++ b/pkgs/os-specific/linux/mstpd/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchsvn }:
+
+stdenv.mkDerivation rec {
+  name = "mstpd-svn-${toString version}";
+  version = 61;
+
+  src = fetchsvn {
+    url = "svn://svn.code.sf.net/p/mstpd/code/trunk";
+    rev = version;
+    sha256 = "0n5vqqqq8hk6iqdz100j9ps4zkz71vyl5qgz5bzjhayab2dyq1fd";
+  };
+
+  patches = [ ./fixes.patch ];
+
+  installFlags = [ "DESTDIR=\${out}" ];
+
+  meta = with stdenv.lib; {
+    description = "Multiple Spanning Tree Protocol daemon";
+    homepage = http://sourceforge.net/projects/mstpd/;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ wkennington ];
+  };
+}
diff --git a/pkgs/os-specific/linux/mstpd/fixes.patch b/pkgs/os-specific/linux/mstpd/fixes.patch
new file mode 100644
index 000000000000..7303e1d7b4d3
--- /dev/null
+++ b/pkgs/os-specific/linux/mstpd/fixes.patch
@@ -0,0 +1,72 @@
+diff --git a/Makefile b/Makefile
+index dde9f81..5af7cab 100644
+--- a/Makefile
++++ b/Makefile
+@@ -34,7 +34,6 @@ install: all
+ 	-mkdir -pv $(DESTDIR)/sbin
+ 	install -m 755 mstpd $(DESTDIR)/sbin/mstpd
+ 	install -m 755 mstpctl $(DESTDIR)/sbin/mstpctl
+-	install -m 755 bridge-stp /sbin/bridge-stp
+ 	-mkdir -pv $(DESTDIR)/lib/mstpctl-utils/
+ 	cp -rv lib/* $(DESTDIR)/lib/mstpctl-utils/
+ 	gzip -f $(DESTDIR)/lib/mstpctl-utils/mstpctl.8
+@@ -42,8 +41,9 @@ install: all
+ 	if [ -d $(DESTDIR)/etc/network/if-pre-up.d ] ; then ln -sf /lib/mstpctl-utils/ifupdown.sh $(DESTDIR)/etc/network/if-pre-up.d/mstpctl ; fi
+ 	if [ -d $(DESTDIR)/etc/network/if-pre-up.d ] ; then ln -sf /lib/mstpctl-utils/ifupdown.sh $(DESTDIR)/etc/network/if-post-down.d/mstpctl ; fi
+ 	if [ -d $(DESTDIR)/etc/bash_completion.d ] ; then ln -sf /lib/mstpctl-utils/bash_completion $(DESTDIR)/etc/bash_completion.d/mstpctl ; fi
+-	ln -sf /lib/mstpctl-utils/mstpctl.8.gz $(DESTDIR)/usr/share/man/man8/mstpctl.8.gz
+-	ln -sf /lib/mstpctl-utils/mstpctl-utils-interfaces.5.gz $(DESTDIR)/usr/share/man/man5/mstpctl-utils-interfaces.5.gz
++	mkdir -p $(DESTDIR)/share/man/man8 $(DESTDIR)/share/man/man5
++	ln -sf /lib/mstpctl-utils/mstpctl.8.gz $(DESTDIR)/share/man/man8/mstpctl.8.gz
++	ln -sf /lib/mstpctl-utils/mstpctl-utils-interfaces.5.gz $(DESTDIR)/share/man/man5/mstpctl-utils-interfaces.5.gz
+ 
+ romfs: all
+ 	$(ROMFSINST) /sbin/mstpd
+diff --git a/bridge_track.c b/bridge_track.c
+index c92fdf6..0c01aec 100644
+--- a/bridge_track.c
++++ b/bridge_track.c
+@@ -28,6 +28,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <linux/param.h>
++#include <linux/in6.h>
+ #include <linux/if_bridge.h>
+ #include <asm/byteorder.h>
+ 
+diff --git a/broadcom_xstrata/driver_deps.c b/broadcom_xstrata/driver_deps.c
+index e72e9e3..5194253 100644
+--- a/broadcom_xstrata/driver_deps.c
++++ b/broadcom_xstrata/driver_deps.c
+@@ -14,6 +14,7 @@
+ #include <unistd.h>
+ #include <fcntl.h>
+ #include <asm/byteorder.h>
++#include <linux/in6.h>
+ #include <linux/if_bridge.h>
+ 
+ #include "log.h"
+diff --git a/ctl_functions.h b/ctl_functions.h
+index 9c3b914..df464de 100644
+--- a/ctl_functions.h
++++ b/ctl_functions.h
+@@ -27,6 +27,7 @@
+ #ifndef CTL_SOCKET_H
+ #define CTL_SOCKET_H
+ 
++#include <linux/in6.h>
+ #include <linux/if_bridge.h>
+ #include <asm/byteorder.h>
+ 
+diff --git a/mstp.c b/mstp.c
+index 1c6a2df..b2a1acd 100644
+--- a/mstp.c
++++ b/mstp.c
+@@ -37,6 +37,7 @@
+ 
+ #include <string.h>
+ #include <sys/time.h>
++#include <linux/in6.h>
+ #include <linux/if_bridge.h>
+ #include <asm/byteorder.h>
+ 
diff --git a/pkgs/os-specific/linux/nfs-utils/default.nix b/pkgs/os-specific/linux/nfs-utils/default.nix
index 9c4905bd5293..e0fc88d995b5 100644
--- a/pkgs/os-specific/linux/nfs-utils/default.nix
+++ b/pkgs/os-specific/linux/nfs-utils/default.nix
@@ -1,18 +1,18 @@
 { fetchurl, stdenv, tcp_wrappers, utillinux, libcap, libtirpc, libevent, libnfsidmap
-, lvm2, e2fsprogs, python
+, lvm2, e2fsprogs, python, sqlite
 }:
 
 stdenv.mkDerivation rec {
-  name = "nfs-utils-1.2.5";
+  name = "nfs-utils-1.3.2";
 
   src = fetchurl {
     url = "mirror://sourceforge/nfs/${name}.tar.bz2";
-    sha256 = "16ssfkj36ljifyaskgwpd3ys8ylhi5gasq88aha3bhg5dr7yv59m";
+    sha256 = "1xwilpdr1vizq2yhpzxpwqqr9f8kn0dy2wcpc626mf30ybp7572v";
   };
 
   buildInputs =
     [ tcp_wrappers utillinux libcap libtirpc libevent libnfsidmap
-      lvm2 e2fsprogs python
+      lvm2 e2fsprogs python sqlite
     ];
 
   # FIXME: Add the dependencies needed for NFSv4 and TI-RPC.
@@ -23,24 +23,21 @@ stdenv.mkDerivation rec {
     ]
     ++ stdenv.lib.optional (stdenv ? glibc) "--with-rpcgen=${stdenv.glibc}/bin/rpcgen";
 
-  patchPhase =
-    ''
-      for i in "tests/"*.sh
-      do
-        sed -i "$i" -e's|/bin/bash|/bin/sh|g'
-        chmod +x "$i"
-      done
-      sed -i s,/usr/sbin,$out/sbin, utils/statd/statd.c
-
-      # https://bugzilla.redhat.com/show_bug.cgi?id=749195
-      sed -i s,PAGE_SIZE,getpagesize\(\), utils/blkmapd/device-process.c
-    '';
+  patches = [ ./no-install.patch ];
 
-  preBuild =
-    ''
-      makeFlags="sbindir=$out/sbin"
-      installFlags="statedir=$TMPDIR" # hack to make `make install' work
-    '';
+  postPatch = ''
+    for i in "tests/"*.sh
+    do
+      sed -i "$i" -e's|/bin/bash|/bin/sh|g'
+      chmod +x "$i"
+    done
+    sed -i s,/usr/sbin,$out/sbin, utils/statd/statd.c
+  '';
+
+  preBuild = ''
+    makeFlags="sbindir=$out/sbin"
+    installFlags="statedir=$TMPDIR" # hack to make `make install' work
+  '';
 
   # One test fails on mips.
   doCheck = !stdenv.isMips;
@@ -58,6 +55,6 @@ stdenv.mkDerivation rec {
     license = stdenv.lib.licenses.gpl2;
 
     platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.ludo ];
+    maintainers = [ ];
   };
 }
diff --git a/pkgs/os-specific/linux/nfs-utils/no-install.patch b/pkgs/os-specific/linux/nfs-utils/no-install.patch
new file mode 100644
index 000000000000..b45008dc0362
--- /dev/null
+++ b/pkgs/os-specific/linux/nfs-utils/no-install.patch
@@ -0,0 +1,19 @@
+diff --git a/Makefile.in b/Makefile.in
+index 6a5c7c2..64342fe 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -872,14 +872,6 @@ uninstall-am:
+ 
+ 
+ install-data-hook:
+-	if [ ! -d $(DESTDIR)$(statedir) ]; then mkdir -p $(DESTDIR)$(statedir); fi
+-	touch $(DESTDIR)$(statedir)/xtab; chmod 644 $(DESTDIR)$(statedir)/xtab
+-	touch $(DESTDIR)$(statedir)/etab; chmod 644 $(DESTDIR)$(statedir)/etab
+-	touch $(DESTDIR)$(statedir)/rmtab; chmod 644 $(DESTDIR)$(statedir)/rmtab
+-	mkdir -p $(DESTDIR)$(statdpath)/sm $(DESTDIR)$(statdpath)/sm.bak
+-	touch $(DESTDIR)$(statdpath)/state
+-	chmod go-rwx $(DESTDIR)$(statdpath)/sm $(DESTDIR)$(statdpath)/sm.bak $(DESTDIR)$(statdpath)/state
+-	-chown $(statduser) $(DESTDIR)$(statdpath)/sm $(DESTDIR)$(statdpath)/sm.bak $(DESTDIR)$(statdpath)/state
+ 
+ uninstall-hook:
+ 	rm $(DESTDIR)$(statedir)/xtab
diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix
index 0d27c89eac2c..63cb33a52a28 100644
--- a/pkgs/os-specific/linux/nvidia-x11/default.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/default.nix
@@ -42,9 +42,9 @@ stdenv.mkDerivation {
   dontStrip = true;
 
   glPath      = makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr];
-  cudaPath    = makeLibraryPath [zlib stdenv.cc.gcc];
+  cudaPath    = makeLibraryPath [zlib stdenv.cc.cc];
   openclPath  = makeLibraryPath [zlib];
-  allLibPath  = makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr zlib stdenv.cc.gcc];
+  allLibPath  = makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr zlib stdenv.cc.cc];
 
   programPath = optionalString (!libsOnly) (makeLibraryPath
     [ gtk atk pango glib gdk_pixbuf xlibs.libXv ] );
diff --git a/pkgs/os-specific/linux/nvidia-x11/legacy173.nix b/pkgs/os-specific/linux/nvidia-x11/legacy173.nix
index 79d8adfb2e17..432a756b6f6b 100644
--- a/pkgs/os-specific/linux/nvidia-x11/legacy173.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/legacy173.nix
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
 
   glPath = stdenv.lib.makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr];
 
-  cudaPath = stdenv.lib.makeLibraryPath [zlib stdenv.cc.gcc];
+  cudaPath = stdenv.lib.makeLibraryPath [zlib stdenv.cc.cc];
 
   programPath = stdenv.lib.makeLibraryPath [ gtk atk pango glib gdk_pixbuf xlibs.libXv ];
 
diff --git a/pkgs/os-specific/linux/nvidia-x11/legacy304.nix b/pkgs/os-specific/linux/nvidia-x11/legacy304.nix
index e37b4354408b..d5e350a0302a 100644
--- a/pkgs/os-specific/linux/nvidia-x11/legacy304.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/legacy304.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation {
 
   glPath = stdenv.lib.makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr];
 
-  cudaPath = stdenv.lib.makeLibraryPath [zlib stdenv.cc.gcc];
+  cudaPath = stdenv.lib.makeLibraryPath [zlib stdenv.cc.cc];
 
   programPath = optionalString (!libsOnly) (stdenv.lib.makeLibraryPath
     [ gtk atk pango glib gdk_pixbuf xlibs.libXv ] );
diff --git a/pkgs/os-specific/linux/nvidia-x11/legacy340.nix b/pkgs/os-specific/linux/nvidia-x11/legacy340.nix
index 7af7e63c388d..e0fd15fad3b1 100644
--- a/pkgs/os-specific/linux/nvidia-x11/legacy340.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/legacy340.nix
@@ -45,9 +45,9 @@ stdenv.mkDerivation {
   dontStrip = true;
 
   glPath      = makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr];
-  cudaPath    = makeLibraryPath [zlib stdenv.cc.gcc];
+  cudaPath    = makeLibraryPath [zlib stdenv.cc.cc];
   openclPath  = makeLibraryPath [zlib];
-  allLibPath  = makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr zlib stdenv.cc.gcc];
+  allLibPath  = makeLibraryPath [xlibs.libXext xlibs.libX11 xlibs.libXrandr zlib stdenv.cc.cc];
 
   programPath = optionalString (!libsOnly) (makeLibraryPath
     [ gtk atk pango glib gdk_pixbuf xlibs.libXv ] );
diff --git a/pkgs/os-specific/linux/ocz-toolbox/default.nix b/pkgs/os-specific/linux/ocz-toolbox/default.nix
index 65d4fa0f07a5..4537cdac3e99 100644
--- a/pkgs/os-specific/linux/ocz-toolbox/default.nix
+++ b/pkgs/os-specific/linux/ocz-toolbox/default.nix
@@ -16,7 +16,7 @@ in stdenv.mkDerivation rec {
     cd linux${arch}
   '';
 
-  libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.gcc libXrender fontconfig freetype libXext libX11 ];
+  libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc libXrender fontconfig freetype libXext libX11 ];
 
   installPhase = ''
     install -Dm755 OCZToolbox $out/bin/OCZToolbox
diff --git a/pkgs/os-specific/linux/opengl/xorg-sys/default.nix b/pkgs/os-specific/linux/opengl/xorg-sys/default.nix
index acd1499a36cd..2cebb8d9dcc2 100644
--- a/pkgs/os-specific/linux/opengl/xorg-sys/default.nix
+++ b/pkgs/os-specific/linux/opengl/xorg-sys/default.nix
@@ -11,6 +11,6 @@
 stdenv.mkDerivation {
   name = "xorg-sys-opengl-3";
   builder = ./builder.sh;
-  neededLibs = [xlibs.libXxf86vm xlibs.libXext expat libdrm stdenv.cc.gcc];
+  neededLibs = [xlibs.libXxf86vm xlibs.libXext expat libdrm stdenv.cc.cc];
 }
 
diff --git a/pkgs/os-specific/linux/pam_krb5/default.nix b/pkgs/os-specific/linux/pam_krb5/default.nix
index 5c0cc033de9f..40e7e1216a64 100644
--- a/pkgs/os-specific/linux/pam_krb5/default.nix
+++ b/pkgs/os-specific/linux/pam_krb5/default.nix
@@ -1,17 +1,17 @@
 { stdenv, fetchurl, pam, kerberos }:
 
 stdenv.mkDerivation rec {
-  name = "pam_krb5-2.4.9";
+  name = "pam-krb5-4.7";
 
   src = fetchurl {
-    url = "https://fedorahosted.org/releases/p/a/pam_krb5/${name}.tar.gz";
-    sha256 = "0vcb35shzp406jvvz0pkgqm8qq1qzhgwmkl0nrm0wrrkqlr22rfb";
+    url = "http://archives.eyrie.org/software/kerberos/${name}.tar.gz";
+    sha256 = "04klg9a2rhdz0a2dw4f0ybcm28vcbab6lrynwq7rm4sn0hnzakwv";
   };
 
   buildInputs = [ pam kerberos ];
 
   meta = with stdenv.lib; {
-    homepage = https://fedorahosted.org/pam_krb5;
+    homepage = http://www.eyrie.org/~eagle/software/pam-krb5/;
     description = "PAM module allowing PAM-aware applications to authenticate users by performing an AS exchange with a Kerberos KDC";
     longDescription = ''
       pam_krb5 can optionally convert Kerberos 5 credentials to Kerberos IV
diff --git a/pkgs/os-specific/linux/pcmciautils/default.nix b/pkgs/os-specific/linux/pcmciautils/default.nix
index 787b72fde480..ce5814965efd 100644
--- a/pkgs/os-specific/linux/pcmciautils/default.nix
+++ b/pkgs/os-specific/linux/pcmciautils/default.nix
@@ -8,11 +8,11 @@
 
 # FIXME: should add an option to choose between hotplug and udev.
 stdenv.mkDerivation rec {
-  name = "pcmciautils-015";
+  name = "pcmciautils-017";
 
   src = fetchurl {
-    url = "http://kernel.org/pub/linux/utils/kernel/pcmcia/${name}.tar.bz2";
-    sha256 = "4847485c412b47e3d88fa83ef811229e0e7941217303bc8449c30a3dc2128b6e";
+    url = "https://kernel.org/pub/linux/utils/kernel/pcmcia/${name}.tar.gz";
+    sha256 = "5d8e2efad8a7f692129610603da232f2144851753d8d49a70eeb8eb1be6f6bc3";
   };
 
   buildInputs = [udev yacc sysfsutils module_init_tools flex];
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
     '') firmware;
 
   meta = {
-    homepage = http://kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html;
+    homepage = https://www.kernel.org/pub/linux/utils/kernel/pcmcia/;
     longDescription = "
       PCMCIAutils contains the initialization tools necessary to allow
       the PCMCIA subsystem to behave (almost) as every other
diff --git a/pkgs/os-specific/linux/prl-tools/default.nix b/pkgs/os-specific/linux/prl-tools/default.nix
index f76d409fcfbe..0dac7c4358d7 100644
--- a/pkgs/os-specific/linux/prl-tools/default.nix
+++ b/pkgs/os-specific/linux/prl-tools/default.nix
@@ -83,7 +83,7 @@ stdenv.mkDerivation rec {
   '';
 
   libPath = with xorg;
-            stdenv.lib.makeLibraryPath ([ stdenv.cc.gcc libXrandr libXext libX11 libXcomposite libXinerama ]
+            stdenv.lib.makeLibraryPath ([ stdenv.cc.cc libXrandr libXext libX11 libXcomposite libXinerama ]
             ++ lib.optionals (!libsOnly) [ libXi glib dbus_glib zlib ]);
 
   desktops = map (x: substituteAll ({
diff --git a/pkgs/os-specific/linux/radeontop/default.nix b/pkgs/os-specific/linux/radeontop/default.nix
new file mode 100644
index 000000000000..7ec74c895c62
--- /dev/null
+++ b/pkgs/os-specific/linux/radeontop/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchFromGitHub, pkgconfig, gettext, ncurses, libdrm, libpciaccess }:
+
+let version = "v0.8-8-g2499679"; in
+stdenv.mkDerivation {
+  name = "radeontop-${version}";
+
+  src = fetchFromGitHub {
+    sha256 = "112zf6ms0qpmr9h3l4lg5wik5j206mgij0nypba5lnqzksxh2f88";
+    rev = "2499679fda60c3f6239886296fd2a74155f45f77";
+    repo = "radeontop";
+    owner = "clbr";
+  };
+
+  buildInputs = [ pkgconfig gettext ncurses libdrm libpciaccess ];
+
+  enableParallelBuilding = true;
+
+  patchPhase = ''
+    substituteInPlace getver.sh --replace ver=unknown ver=${version}
+  '';
+
+  makeFlags = "PREFIX=$(out)";
+
+  meta = with stdenv.lib; {
+    description = "Top-like tool for viewing AMD Radeon GPU utilization";
+    longDescription = ''
+      View GPU utilization, both for the total activity percent and individual
+      blocks. Supports R600 and later cards: even Southern Islands should work.
+      Works with both the open drivers and AMD Catalyst. Total GPU utilization
+      is also valid for OpenCL loads; the other blocks are only useful for GL
+      loads. Requires root rights or other permissions to read /dev/mem.
+    '';
+    homepage = https://github.com/clbr/radeontop;
+    platforms = platforms.linux;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ rycee nckx ];
+  };
+}
diff --git a/pkgs/os-specific/linux/sdparm/default.nix b/pkgs/os-specific/linux/sdparm/default.nix
index 30943d8cd413..3b0f7c694ac0 100644
--- a/pkgs/os-specific/linux/sdparm/default.nix
+++ b/pkgs/os-specific/linux/sdparm/default.nix
@@ -1,16 +1,17 @@
 {stdenv, fetchurl}:
 
 stdenv.mkDerivation {
-  name = "sdparm-1.08";
+  name = "sdparm-1.09";
 
   src = fetchurl {
-    url = http://sg.danny.cz/sg/p/sdparm-1.08.tgz;
-    sha256 = "0msy8anggdand1yr50vg2azcfgks7sbfpnqk7xzw9adi2jj7hsrp";
+    url = http://sg.danny.cz/sg/p/sdparm-1.09.tar.xz;
+    sha256 = "0jakqyjwi72zqjzss04bally0xl0lc4710mx8da08vpmir1hfphg";
   };
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://sg.danny.cz/sg/sdparm.html;
     description = "A utility to access SCSI device parameters";
-    license = stdenv.lib.licenses.free;
+    license = with licenses; bsd3;
+    maintainers = with maintainers; [ nckx ];
   };
 }
diff --git a/pkgs/os-specific/linux/spl/default.nix b/pkgs/os-specific/linux/spl/default.nix
index 0648be4e41a1..618b59b32aa5 100644
--- a/pkgs/os-specific/linux/spl/default.nix
+++ b/pkgs/os-specific/linux/spl/default.nix
@@ -1,7 +1,6 @@
-{ stdenv, fetchFromGitHub, kernel, perl, autoconf, automake, libtool, coreutils, gawk }:
+{ callPackage, fetchFromGitHub, ... } @ args:
 
-stdenv.mkDerivation rec {
-  name = "spl-${version}-${kernel.version}";
+callPackage ./generic.nix (args // rec {
   version = "0.6.3-1.2";
 
   src = fetchFromGitHub {
@@ -11,39 +10,5 @@ stdenv.mkDerivation rec {
     sha256 = "0id0m3sfpkz8w7b2pc51px8kvz8xnaf8msps57ddarxidmxvb45g";
   };
 
-  patches = [ ./install_prefix.patch ./const.patch ];
-
-  buildInputs = [ perl autoconf automake libtool ];
-
-  preConfigure = ''
-    ./autogen.sh
-
-    substituteInPlace ./module/spl/spl-generic.c --replace /usr/bin/hostid hostid
-    substituteInPlace ./module/spl/spl-module.c  --replace /bin/mknod mknod
-
-    substituteInPlace ./module/spl/spl-generic.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:${gawk}:/bin"
-    substituteInPlace ./module/splat/splat-vnode.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
-    substituteInPlace ./module/splat/splat-linux.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
-  '';
-
-  configureFlags = ''
-     --with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source
-     --with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build
-  '';
-
-  enableParallelBuilding = true;
-
-  meta = {
-    description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)";
-
-    longDescription = ''
-      This kernel module is a porting layer for ZFS to work inside the linux
-      kernel.
-    '';
-
-    homepage = http://zfsonlinux.org/;
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.gpl2Plus;
-    maintainers = with stdenv.lib.maintainers; [ jcumming wizeman ];
-  };
-}
+  patches = [ ./install_prefix.patch ./const.patch ./time.patch ];
+})
diff --git a/pkgs/os-specific/linux/spl/generic.nix b/pkgs/os-specific/linux/spl/generic.nix
new file mode 100644
index 000000000000..c25ff6608e21
--- /dev/null
+++ b/pkgs/os-specific/linux/spl/generic.nix
@@ -0,0 +1,61 @@
+{ stdenv, autoconf, automake, libtool, coreutils, gawk
+, configFile ? "all"
+
+# Kernel dependencies
+, kernel ? null
+
+# Version specific parameters
+, version, src, patches
+, ...
+}:
+
+with stdenv.lib;
+let
+  buildKernel = any (n: n == configFile) [ "kernel" "all" ];
+  buildUser = any (n: n == configFile) [ "user" "all" ];
+in
+
+assert any (n: n == configFile) [ "kernel" "user" "all" ];
+assert buildKernel -> kernel != null;
+
+stdenv.mkDerivation rec {
+  name = "spl-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
+
+  inherit version src patches;
+
+  buildInputs = [ autoconf automake libtool ];
+
+  preConfigure = ''
+    ./autogen.sh
+
+    substituteInPlace ./module/spl/spl-generic.c --replace /usr/bin/hostid hostid
+    substituteInPlace ./module/spl/spl-module.c  --replace /bin/mknod mknod
+
+    substituteInPlace ./module/spl/spl-generic.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:${gawk}:/bin"
+    substituteInPlace ./module/splat/splat-vnode.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
+    substituteInPlace ./module/splat/splat-linux.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
+  '';
+
+  configureFlags = [
+    "--with-config=${configFile}"
+  ] ++ optionals buildKernel [
+    "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
+    "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)";
+
+    longDescription = ''
+      This kernel module is a porting layer for ZFS to work inside the linux
+      kernel.
+    '';
+
+    homepage = http://zfsonlinux.org/;
+    platforms = platforms.linux;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ jcumming wizeman wkennington ];
+  };
+}
diff --git a/pkgs/os-specific/linux/spl/git.nix b/pkgs/os-specific/linux/spl/git.nix
index 93629495164b..fc204bc02321 100644
--- a/pkgs/os-specific/linux/spl/git.nix
+++ b/pkgs/os-specific/linux/spl/git.nix
@@ -1,46 +1,13 @@
-{ stdenv, fetchgit, kernel, perl, autoconf, automake, libtool, coreutils, gawk }:
+{ callPackage, fetchgit, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "086476f";
 
-stdenv.mkDerivation {
-  name = "spl-0.6.3-${kernel.version}";
   src = fetchgit {
     url = git://github.com/zfsonlinux/spl.git;
-    rev = "31cb5383bff0fddc5058973e32a6f2c446d45e59";
-    sha256 = "0mcivbddms8kbapbs9x6achqyvh5i6h1rd2b3jm8g5yjn0flc5gl";
+    rev = "086476f92005506cb07e75f889e8ddb69026e842";
+    sha256 = "1n3cjdwxccvcns7jydgznkb6jy0p59qx1yg512jjf4m9hf5p2pwm";
   };
 
-  patches = [ ./install_prefix.patch ./const.patch ./kernel-3.16.patch ./kernel-3.17.patch ];
-
-  buildInputs = [ perl autoconf automake libtool ];
-
-  preConfigure = ''
-    ./autogen.sh
-
-    substituteInPlace ./module/spl/spl-generic.c --replace /usr/bin/hostid hostid
-    substituteInPlace ./module/spl/spl-module.c  --replace /bin/mknod mknod
-
-    substituteInPlace ./module/spl/spl-generic.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:${gawk}:/bin"
-    substituteInPlace ./module/splat/splat-vnode.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
-    substituteInPlace ./module/splat/splat-linux.c --replace "PATH=/sbin:/usr/sbin:/bin:/usr/bin" "PATH=${coreutils}:/bin"
-  '';
-
-  configureFlags = ''
-     --with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source
-     --with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build
-  '';
-
-  enableParallelBuilding = true;
-
-  meta = {
-    description = "Kernel module driver for solaris porting layer (needed by in-kernel zfs)";
-
-    longDescription = ''
-      This kernel module is a porting layer for ZFS to work inside the linux
-      kernel.
-    '';
-
-    homepage = http://zfsonlinux.org/;
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.gpl2Plus;
-    maintainers = with stdenv.lib.maintainers; [ wizeman ];
-  };
-}
+  patches = [ ./const.patch ./install_prefix-git.patch ];
+})
diff --git a/pkgs/os-specific/linux/spl/install_prefix-git.patch b/pkgs/os-specific/linux/spl/install_prefix-git.patch
new file mode 100644
index 000000000000..0f12f531f7ae
--- /dev/null
+++ b/pkgs/os-specific/linux/spl/install_prefix-git.patch
@@ -0,0 +1,173 @@
+diff --git a/Makefile.am b/Makefile.am
+index 89af931..674420c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -12,10 +12,10 @@ endif
+ if CONFIG_KERNEL
+ SUBDIRS += module
+ 
+-extradir = @prefix@/src/spl-$(VERSION)
++extradir = @prefix@/libexec/spl
+ extra_HEADERS = spl.release.in spl_config.h.in
+ 
+-kerneldir = @prefix@/src/spl-$(VERSION)/$(LINUX_VERSION)
++kerneldir = @prefix@/libexec/spl/$(LINUX_VERSION)
+ nodist_kernel_HEADERS = spl.release spl_config.h module/$(LINUX_SYMBOLS)
+ endif
+ 
+diff --git a/include/Makefile.am b/include/Makefile.am
+index 3200222..4a47aaa 100644
+--- a/include/Makefile.am
++++ b/include/Makefile.am
+@@ -13,6 +13,6 @@ USER_H =
+ EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/spl-$(VERSION)/include
++kerneldir = @prefix@/libexec/spl/include
+ kernel_HEADERS = $(KERNEL_H)
+ endif
+diff --git a/include/fs/Makefile.am b/include/fs/Makefile.am
+index e0da4b3..d6d7af0 100644
+--- a/include/fs/Makefile.am
++++ b/include/fs/Makefile.am
+@@ -8,6 +8,6 @@ USER_H =
+ EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/spl-$(VERSION)/include/fs
++kerneldir = @prefix@/libexec/spl/include/fs
+ kernel_HEADERS = $(KERNEL_H)
+ endif
+diff --git a/include/linux/Makefile.am b/include/linux/Makefile.am
+index 1cca44a..e0d843b 100644
+--- a/include/linux/Makefile.am
++++ b/include/linux/Makefile.am
+@@ -19,6 +19,6 @@ USER_H =
+ EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/spl-$(VERSION)/include/linux
++kerneldir = @prefix@/libexec/spl/include/linux
+ kernel_HEADERS = $(KERNEL_H)
+ endif
+diff --git a/include/rpc/Makefile.am b/include/rpc/Makefile.am
+index cfc8246..4fbd33d 100644
+--- a/include/rpc/Makefile.am
++++ b/include/rpc/Makefile.am
+@@ -9,6 +9,6 @@ USER_H =
+ EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/spl-$(VERSION)/include/rpc
++kerneldir = @prefix@/libexec/spl/include/rpc
+ kernel_HEADERS = $(KERNEL_H)
+ endif
+diff --git a/include/sharefs/Makefile.am b/include/sharefs/Makefile.am
+index 10e7093..febecdf 100644
+--- a/include/sharefs/Makefile.am
++++ b/include/sharefs/Makefile.am
+@@ -8,6 +8,6 @@ USER_H =
+ EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/spl-$(VERSION)/include/sharefs
++kerneldir = @prefix@/libexec/spl/include/sharefs
+ kernel_HEADERS = $(KERNEL_H)
+ endif
+diff --git a/include/sys/Makefile.am b/include/sys/Makefile.am
+index 2d21c57..3958cfd 100644
+--- a/include/sys/Makefile.am
++++ b/include/sys/Makefile.am
+@@ -104,7 +104,7 @@ USER_H =
+ EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/spl-$(VERSION)/include/sys
++kerneldir = @prefix@/libexec/spl/include/sys
+ kernel_HEADERS = $(KERNEL_H)
+ endif
+ 
+diff --git a/include/sys/fm/Makefile.am b/include/sys/fm/Makefile.am
+index 2821cbe..a84ce8e 100644
+--- a/include/sys/fm/Makefile.am
++++ b/include/sys/fm/Makefile.am
+@@ -9,6 +9,6 @@ USER_H =
+ EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/spl-$(VERSION)/include/sys/fm
++kerneldir = @prefix@/libexec/spl/include/sys/fm
+ kernel_HEADERS = $(KERNEL_H)
+ endif
+diff --git a/include/sys/fs/Makefile.am b/include/sys/fs/Makefile.am
+index 581083e..0c35fb7 100644
+--- a/include/sys/fs/Makefile.am
++++ b/include/sys/fs/Makefile.am
+@@ -8,6 +8,6 @@ USER_H =
+ EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/spl-$(VERSION)/include/sys/fs
++kerneldir = @prefix@/libexec/spl/include/sys/fs
+ kernel_HEADERS = $(KERNEL_H)
+ endif
+diff --git a/include/sys/sysevent/Makefile.am b/include/sys/sysevent/Makefile.am
+index 63d9af3..de1aa18 100644
+--- a/include/sys/sysevent/Makefile.am
++++ b/include/sys/sysevent/Makefile.am
+@@ -8,6 +8,6 @@ USER_H =
+ EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/spl-$(VERSION)/include/sys/sysevent
++kerneldir = @prefix@/libexec/spl/include/sys/sysevent
+ kernel_HEADERS = $(KERNEL_H)
+ endif
+diff --git a/include/util/Makefile.am b/include/util/Makefile.am
+index b721b50..cbb9a05 100644
+--- a/include/util/Makefile.am
++++ b/include/util/Makefile.am
+@@ -9,6 +9,6 @@ USER_H =
+ EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/spl-$(VERSION)/include/util
++kerneldir = @prefix@/libexec/spl/include/util
+ kernel_HEADERS = $(KERNEL_H)
+ endif
+diff --git a/include/vm/Makefile.am b/include/vm/Makefile.am
+index 7faab0a..8148b3d 100644
+--- a/include/vm/Makefile.am
++++ b/include/vm/Makefile.am
+@@ -10,6 +10,6 @@ USER_H =
+ EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/spl-$(VERSION)/include/vm
++kerneldir = @prefix@/libexec/spl/include/vm
+ kernel_HEADERS = $(KERNEL_H)
+ endif
+diff --git a/module/Makefile.in b/module/Makefile.in
+index 41c1010..3141397 100644
+--- a/module/Makefile.in
++++ b/module/Makefile.in
+@@ -21,15 +21,15 @@ clean:
+ modules_install:
+ 	@# Install the kernel modules
+ 	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` $@ \
+-		INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \
++		INSTALL_MOD_PATH=@prefix@/$(INSTALL_MOD_PATH) \
+ 		INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
+ 		KERNELRELEASE=@LINUX_VERSION@
+ 	@# Remove extraneous build products when packaging
+-	kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
++	kmoddir=@prefix@/$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
+ 	if [ -n $$kmoddir ]; then \
+ 		find $$kmoddir -name 'modules.*' | xargs $(RM); \
+ 	fi
+-	sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
++	sysmap=@prefix@/$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
+ 	if [ -f $$sysmap ]; then \
+ 		depmod -ae -F $$sysmap @LINUX_VERSION@; \
+ 	fi
diff --git a/pkgs/os-specific/linux/spl/kernel-3.16.patch b/pkgs/os-specific/linux/spl/kernel-3.16.patch
deleted file mode 100644
index 25641c7a384f..000000000000
--- a/pkgs/os-specific/linux/spl/kernel-3.16.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-From e3020723dc43af2bc22af0d68571a61daf9b44d0 Mon Sep 17 00:00:00 2001
-From: Turbo Fredriksson <turbo@bayour.com>
-Date: Sun, 14 Sep 2014 15:47:22 +0000
-Subject: [PATCH] Linux 3.16 compat: smp_mb__after_clear_bit()
-
-The smp_mb__{before,after}_clear_bit functions have been renamed
-smp_mb__{before,after}_atomic.  Rather than adding a compatibility
-function to handle this the code has been updated to use smp_wmb().
-
-This has the advantage of being a stable functionally equivalent
-interface.  On many architectures smp_mb__after_clear_bit() expands
-to smp_wmb().  Others might be able to do something slightly more
-efficient but this will be safe and correct on all of them.
-
-Signed-off-by: Turbo Fredriksson <turbo@bayour.com>
-Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
-Closes #386
----
- module/spl/spl-kmem.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c
-index 6de513e..79954eb 100644
---- a/module/spl/spl-kmem.c
-+++ b/module/spl/spl-kmem.c
-@@ -2365,7 +2365,7 @@ spl_kmem_cache_reap_now(spl_kmem_cache_t *skc, int count)
- 
- 	spl_slab_reclaim(skc, count, 1);
- 	clear_bit(KMC_BIT_REAPING, &skc->skc_flags);
--	smp_mb__after_clear_bit();
-+	smp_wmb();
- 	wake_up_bit(&skc->skc_flags, KMC_BIT_REAPING);
- out:
- 	atomic_dec(&skc->skc_ref);
diff --git a/pkgs/os-specific/linux/spl/kernel-3.17.patch b/pkgs/os-specific/linux/spl/kernel-3.17.patch
deleted file mode 100644
index f5ce2c8805d8..000000000000
--- a/pkgs/os-specific/linux/spl/kernel-3.17.patch
+++ /dev/null
@@ -1,175 +0,0 @@
-From 2fc44f66ec9b83069593d87cf311069458c0d5ae Mon Sep 17 00:00:00 2001
-From: Ned Bass <bass6@llnl.gov>
-Date: Fri, 8 Aug 2014 17:41:22 -0700
-Subject: [PATCH] Linux 3.17 compat: remove wait_on_bit action function
-
-Linux kernel 3.17 removes the action function argument from
-wait_on_bit().  Add autoconf test and compatibility macro to support
-the new interface.
-
-The former "wait_on_bit" interface required an 'action' function to
-be provided which does the actual waiting. There were over 20 such
-functions in the kernel, many of them identical, though most cases
-can be satisfied by one of just two functions: one which uses
-io_schedule() and one which just uses schedule().  This API change
-was made to consolidate all of those redundant wait functions.
-
-References: torvalds/linux@7431620
-
-Signed-off-by: Ned Bass <bass6@llnl.gov>
-Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
-Closes #378
----
- config/spl-build.m4         | 26 ++++++++++++++++++++++++++
- include/linux/Makefile.am   |  1 +
- include/linux/wait_compat.h | 45 +++++++++++++++++++++++++++++++++++++++++++++
- include/sys/types.h         |  1 +
- module/spl/spl-kmem.c       | 11 ++---------
- 5 files changed, 75 insertions(+), 9 deletions(-)
- create mode 100644 include/linux/wait_compat.h
-
-diff --git a/config/spl-build.m4 b/config/spl-build.m4
-index eef5233..2514d8c 100644
---- a/config/spl-build.m4
-+++ b/config/spl-build.m4
-@@ -94,6 +94,7 @@ AC_DEFUN([SPL_AC_CONFIG_KERNEL], [
- 	SPL_AC_2ARGS_VFS_GETATTR
- 	SPL_AC_USLEEP_RANGE
- 	SPL_AC_KMEM_CACHE_ALLOCFLAGS
-+	SPL_AC_WAIT_ON_BIT
- ])
- 
- AC_DEFUN([SPL_AC_MODULE_SYMVERS], [
-@@ -2570,3 +2571,28 @@ AC_DEFUN([SPL_AC_KMEM_CACHE_ALLOCFLAGS], [
- 		])
- 	])
- ])
-+
-+dnl #
-+dnl # 3.17 API change,
-+dnl # wait_on_bit() no longer requires an action argument. The former
-+dnl # "wait_on_bit" interface required an 'action' function to be provided
-+dnl # which does the actual waiting. There were over 20 such functions in the
-+dnl # kernel, many of them identical, though most cases can be satisfied by one
-+dnl # of just two functions: one which uses io_schedule() and one which just
-+dnl # uses schedule().  This API change was made to consolidate all of those
-+dnl # redundant wait functions.
-+dnl #
-+AC_DEFUN([SPL_AC_WAIT_ON_BIT], [
-+	AC_MSG_CHECKING([whether wait_on_bit() takes an action])
-+	SPL_LINUX_TRY_COMPILE([
-+		#include <linux/wait.h>
-+	],[
-+		int (*action)(void *) = NULL;
-+		wait_on_bit(NULL, 0, action, 0);
-+	],[
-+		AC_MSG_RESULT(yes)
-+		AC_DEFINE(HAVE_WAIT_ON_BIT_ACTION, 1, [yes])
-+	],[
-+		AC_MSG_RESULT(no)
-+	])
-+])
-diff --git a/include/linux/Makefile.am b/include/linux/Makefile.am
-index 59f2ec5..ec7023d 100644
---- a/include/linux/Makefile.am
-+++ b/include/linux/Makefile.am
-@@ -17,6 +17,7 @@ KERNEL_H = \
- 	$(top_srcdir)/include/linux/sysctl_compat.h \
- 	$(top_srcdir)/include/linux/time_compat.h \
- 	$(top_srcdir)/include/linux/uaccess_compat.h \
-+	$(top_srcdir)/include/linux/wait_compat.h \
- 	$(top_srcdir)/include/linux/zlib_compat.h
- 
- USER_H =
-diff --git a/include/linux/wait_compat.h b/include/linux/wait_compat.h
-new file mode 100644
-index 0000000..66f9a9a
---- /dev/null
-+++ b/include/linux/wait_compat.h
-@@ -0,0 +1,45 @@
-+/*****************************************************************************\
-+ *  Copyright (C) 2007-2014 Lawrence Livermore National Security, LLC.
-+ *  Copyright (C) 2007 The Regents of the University of California.
-+ *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
-+ *  Written by Brian Behlendorf <behlendorf1@llnl.gov>.
-+ *  UCRL-CODE-235197
-+ *
-+ *  This file is part of the SPL, Solaris Porting Layer.
-+ *  For details, see <http://zfsonlinux.org/>.
-+ *
-+ *  The SPL is free software; you can redistribute it and/or modify it
-+ *  under the terms of the GNU General Public License as published by the
-+ *  Free Software Foundation; either version 2 of the License, or (at your
-+ *  option) any later version.
-+ *
-+ *  The SPL is distributed in the hope that it will be useful, but WITHOUT
-+ *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-+ *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-+ *  for more details.
-+ *
-+ *  You should have received a copy of the GNU General Public License along
-+ *  with the SPL.  If not, see <http://www.gnu.org/licenses/>.
-+\*****************************************************************************/
-+
-+#ifndef _SPL_WAIT_COMPAT_H
-+#define _SPL_WAIT_COMPAT_H
-+
-+
-+#ifndef HAVE_WAIT_ON_BIT_ACTION
-+#  define spl_wait_on_bit(word, bit, mode) wait_on_bit(word, bit, mode)
-+#else
-+
-+static inline int
-+spl_bit_wait(void *word)
-+{
-+        schedule();
-+        return 0;
-+}
-+
-+#define spl_wait_on_bit(word, bit, mode)			\
-+	wait_on_bit(word, bit, spl_bit_wait, mode)
-+
-+#endif /* HAVE_WAIT_ON_BIT_ACTION */
-+
-+#endif /* SPL_WAIT_COMPAT_H */
-diff --git a/include/sys/types.h b/include/sys/types.h
-index decb6bb..fcec0fa 100644
---- a/include/sys/types.h
-+++ b/include/sys/types.h
-@@ -43,6 +43,7 @@
- #include <linux/zlib_compat.h>
- #include <linux/mm_compat.h>
- #include <linux/delay.h>
-+#include <linux/wait_compat.h>
- 
- #ifndef HAVE_UINTPTR_T
- typedef unsigned long			uintptr_t;
-diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c
-index 0a9d775..6de513e 100644
---- a/module/spl/spl-kmem.c
-+++ b/module/spl/spl-kmem.c
-@@ -1900,13 +1900,6 @@ spl_cache_grow_wait(spl_kmem_cache_t *skc)
- 	return !test_bit(KMC_BIT_GROWING, &skc->skc_flags);
- }
- 
--static int
--spl_cache_reclaim_wait(void *word)
--{
--	schedule();
--	return 0;
--}
--
- /*
-  * No available objects on any slabs, create a new slab.  Note that this
-  * functionality is disabled for KMC_SLAB caches which are backed by the
-@@ -1928,8 +1921,8 @@ spl_cache_grow(spl_kmem_cache_t *skc, int flags, void **obj)
- 	 * then return so the local magazine can be rechecked for new objects.
- 	 */
- 	if (test_bit(KMC_BIT_REAPING, &skc->skc_flags)) {
--		rc = wait_on_bit(&skc->skc_flags, KMC_BIT_REAPING,
--		    spl_cache_reclaim_wait, TASK_UNINTERRUPTIBLE);
-+		rc = spl_wait_on_bit(&skc->skc_flags, KMC_BIT_REAPING,
-+		    TASK_UNINTERRUPTIBLE);
- 		SRETURN(rc ? rc : -EAGAIN);
- 	}
- 
diff --git a/pkgs/os-specific/linux/spl/time.patch b/pkgs/os-specific/linux/spl/time.patch
new file mode 100644
index 000000000000..6b1e23bc05ef
--- /dev/null
+++ b/pkgs/os-specific/linux/spl/time.patch
@@ -0,0 +1,18 @@
+diff --git a/module/spl/spl-time.c b/module/spl/spl-time.c
+index 0ed49cc..b0fad4f 100644
+--- a/module/spl/spl-time.c
++++ b/module/spl/spl-time.c
+@@ -40,12 +40,7 @@ extern unsigned long long monotonic_clock(void);
+ void
+ __gethrestime(timestruc_t *ts)
+ {
+-	struct timespec tspec;
+-
+-	getnstimeofday(&tspec);
+-
+-	ts->tv_sec = tspec.tv_sec;
+-	ts->tv_nsec = tspec.tv_nsec;
++	*ts = current_kernel_time();
+ }
+ EXPORT_SYMBOL(__gethrestime);
+ 
diff --git a/pkgs/os-specific/linux/sysdig/default.nix b/pkgs/os-specific/linux/sysdig/default.nix
index 6b9526c15b27..1dec2dcb80b8 100644
--- a/pkgs/os-specific/linux/sysdig/default.nix
+++ b/pkgs/os-specific/linux/sysdig/default.nix
@@ -3,10 +3,10 @@ let
   inherit (stdenv.lib) optional optionalString;
   s = rec {
     baseName="sysdig";
-    version = "0.1.93";
+    version = "0.1.95";
     name="${baseName}-${version}";
     url="https://github.com/draios/sysdig/archive/${version}.tar.gz";
-    sha256 = "0rcbls1i82z2mwd3kcsidvhbb0xf0f4p7l2z3168wbpsh5nm9clz";
+    sha256 = "1h7yjfpgnhmzvc9862k7salc80sw7chmxx5chh4xw1lzsjz1nz5s";
   };
   buildInputs = [
     cmake zlib luajit
diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix
index e1b8f9ea92c0..a55d71a3c08c 100644
--- a/pkgs/os-specific/linux/systemd/default.nix
+++ b/pkgs/os-specific/linux/systemd/default.nix
@@ -86,7 +86,7 @@ stdenv.mkDerivation rec {
 
   # This is needed because systemd uses the gold linker, which doesn't
   # yet have the wrapper script to add rpath flags automatically.
-  NIX_LDFLAGS = "-rpath ${pam}/lib -rpath ${libcap}/lib -rpath ${acl}/lib -rpath ${stdenv.cc.gcc}/lib";
+  NIX_LDFLAGS = "-rpath ${pam}/lib -rpath ${libcap}/lib -rpath ${acl}/lib -rpath ${stdenv.cc.cc}/lib";
 
   PYTHON_BINARY = "${coreutils}/bin/env python"; # don't want a build time dependency on Python
 
diff --git a/pkgs/os-specific/linux/util-linux/default.nix b/pkgs/os-specific/linux/util-linux/default.nix
index 3b76eb63ea5f..8842e76362a3 100644
--- a/pkgs/os-specific/linux/util-linux/default.nix
+++ b/pkgs/os-specific/linux/util-linux/default.nix
@@ -8,6 +8,16 @@ stdenv.mkDerivation rec {
     sha256 = "e0457f715b73f4a349e1acb08cb410bf0edc9a74a3f75c357070f31f70e33cd6";
   };
 
+  patches = [ ./rtcwake-search-PATH-for-shutdown.patch ];
+
+  #FIXME: make it also work on non-nixos?
+  postPatch = ''
+    # Substituting store paths would create a circular dependency on systemd
+    substituteInPlace include/pathnames.h \
+      --replace "/bin/login" "/run/current-system/sw/bin/login" \
+      --replace "/sbin/shutdown" "/run/current-system/sw/bin/shutdown"
+  '';
+
   crossAttrs = {
     # Work around use of `AC_RUN_IFELSE'.
     preConfigure = "export scanf_cv_type_modifier=ms";
diff --git a/pkgs/os-specific/linux/util-linux/rtcwake-search-PATH-for-shutdown.patch b/pkgs/os-specific/linux/util-linux/rtcwake-search-PATH-for-shutdown.patch
new file mode 100644
index 000000000000..92cb07d43834
--- /dev/null
+++ b/pkgs/os-specific/linux/util-linux/rtcwake-search-PATH-for-shutdown.patch
@@ -0,0 +1,30 @@
+Search $PATH for the shutdown binary instead of hard-coding /sbin/shutdown,
+which isn't valid on NixOS (and a compatibility link on most other modern
+distros anyway).
+
+  -- nckx <tobias.geerinckx.rice@gmail.com>
+
+diff -Naur a/include/pathnames.h b/include/pathnames.h
+--- a/include/pathnames.h	2014-09-16 14:37:06.138551680 +0200
++++ b/include/pathnames.h	2015-01-01 20:41:02.510948314 +0100
+@@ -43,7 +43,7 @@
+ #define _PATH_INITTAB		"/etc/inittab"
+ #define _PATH_RC		"/etc/rc"
+ #define _PATH_REBOOT		"/sbin/reboot"
+-#define _PATH_SHUTDOWN		"/sbin/shutdown"
++#define _PATH_SHUTDOWN		"shutdown"
+ #define _PATH_SINGLE		"/etc/singleboot"
+ #define _PATH_SHUTDOWN_CONF	"/etc/shutdown.conf"
+ 
+diff -Naur a/sys-utils/rtcwake.c b/sys-utils/rtcwake.c
+--- a/sys-utils/rtcwake.c	2014-10-24 11:21:20.447389309 +0200
++++ b/sys-utils/rtcwake.c	2015-01-01 20:57:59.398911209 +0100
+@@ -582,7 +582,7 @@
+ 		arg[i]   = NULL;
+ 
+ 		if (!dryrun) {
+-			execv(arg[0], arg);
++			execvp(arg[0], arg);
+ 
+ 			warn(_("failed to execute %s"), _PATH_SHUTDOWN);
+ 			rc = EXIT_FAILURE;
diff --git a/pkgs/os-specific/linux/xf86-input-wacom/default.nix b/pkgs/os-specific/linux/xf86-input-wacom/default.nix
index 2d3dc4888a3a..5242aabe507c 100644
--- a/pkgs/os-specific/linux/xf86-input-wacom/default.nix
+++ b/pkgs/os-specific/linux/xf86-input-wacom/default.nix
@@ -3,11 +3,11 @@
 , ncurses, pkgconfig, randrproto, xorgserver, xproto, udev, libXinerama, pixman }:
 
 stdenv.mkDerivation rec {
-  name = "xf86-input-wacom-0.27.0";
+  name = "xf86-input-wacom-0.28.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/linuxwacom/${name}.tar.bz2";
-    sha256 = "0hpc0waa91d34h2fw1sjhxzn2xya51627jrps9rw4a2zb5hh6a6i";
+    sha256 = "0fr4ssdam8nxkahznqril8q2pbakb4r9ghhg61yl7997yy7006bw";
   };
 
   buildInputs = [ inputproto libX11 libXext libXi libXrandr libXrender
diff --git a/pkgs/os-specific/linux/zfs/3.19-compat-git.patch b/pkgs/os-specific/linux/zfs/3.19-compat-git.patch
new file mode 100644
index 000000000000..07c4eb55acda
--- /dev/null
+++ b/pkgs/os-specific/linux/zfs/3.19-compat-git.patch
@@ -0,0 +1,146 @@
+From 5a562310d706c3c2f2adc067fe73f1061c4fc386 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@higgsboson.tk>
+Date: Sat, 7 Feb 2015 13:41:01 +0100
+Subject: [PATCH] Linux 3.19 compat: file_inode was added
+
+struct access f->f_dentry->d_inode was replaced by accessor function
+file_inode(f)
+---
+ config/kernel-file-inode.m4 | 20 ++++++++++++++++++++
+ config/kernel.m4            |  1 +
+ include/linux/Makefile.am   |  1 +
+ include/linux/fs_compat.h   | 38 ++++++++++++++++++++++++++++++++++++++
+ include/sys/zpl.h           |  1 +
+ module/zfs/zpl_file.c       |  4 ++--
+ 6 files changed, 63 insertions(+), 2 deletions(-)
+ create mode 100644 config/kernel-file-inode.m4
+ create mode 100644 include/linux/fs_compat.h
+
+diff --git a/config/kernel-file-inode.m4 b/config/kernel-file-inode.m4
+new file mode 100644
+index 0000000..13af4e6
+--- /dev/null
++++ b/config/kernel-file-inode.m4
+@@ -0,0 +1,20 @@
++dnl #
++dnl # 3.19 API change
++dnl # struct access f->f_dentry->d_inode was replaced by accessor function
++dnl # file_inode(f)
++dnl #
++AC_DEFUN([ZFS_AC_KERNEL_FILE_INODE], [
++	AC_MSG_CHECKING([whether file_inode() is available])
++	ZFS_LINUX_TRY_COMPILE([
++		#include <linux/fs.h>
++	],[
++		struct file *f = NULL;
++		file_inode(f);
++	],[
++		AC_MSG_RESULT(yes)
++		AC_DEFINE(HAVE_FILE_INODE, 1,
++		          [file_inode() is available])
++	],[
++		AC_MSG_RESULT(no)
++	])
++])
+diff --git a/config/kernel.m4 b/config/kernel.m4
+index bdfb19c..e0b7954 100644
+--- a/config/kernel.m4
++++ b/config/kernel.m4
+@@ -61,6 +61,7 @@ AC_DEFUN([ZFS_AC_CONFIG_KERNEL], [
+ 	ZFS_AC_KERNEL_INODE_OPERATIONS_GET_ACL
+ 	ZFS_AC_KERNEL_CURRENT_UMASK
+ 	ZFS_AC_KERNEL_SHOW_OPTIONS
++	ZFS_AC_KERNEL_FILE_INODE
+ 	ZFS_AC_KERNEL_FSYNC
+ 	ZFS_AC_KERNEL_EVICT_INODE
+ 	ZFS_AC_KERNEL_DIRTY_INODE_WITH_FLAGS
+diff --git a/include/linux/Makefile.am b/include/linux/Makefile.am
+index d00b1c8..480af26 100644
+--- a/include/linux/Makefile.am
++++ b/include/linux/Makefile.am
+@@ -4,6 +4,7 @@ KERNEL_H = \
+ 	$(top_srcdir)/include/linux/dcache_compat.h \
+ 	$(top_srcdir)/include/linux/xattr_compat.h \
+ 	$(top_srcdir)/include/linux/vfs_compat.h \
++	$(top_srcdir)/include/linux/fs_compat.h \
+ 	$(top_srcdir)/include/linux/blkdev_compat.h \
+ 	$(top_srcdir)/include/linux/utsname_compat.h
+ 
+diff --git a/include/linux/fs_compat.h b/include/linux/fs_compat.h
+new file mode 100644
+index 0000000..7860d75
+--- /dev/null
++++ b/include/linux/fs_compat.h
+@@ -0,0 +1,38 @@
++/*
++ * CDDL HEADER START
++ *
++ * The contents of this file are subject to the terms of the
++ * Common Development and Distribution License (the "License").
++ * You may not use this file except in compliance with the License.
++ *
++ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
++ * or http://www.opensolaris.org/os/licensing.
++ * See the License for the specific language governing permissions
++ * and limitations under the License.
++ *
++ * When distributing Covered Code, include this CDDL HEADER in each
++ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
++ * If applicable, add the following below this CDDL HEADER, with the
++ * fields enclosed by brackets "[]" replaced with your own identifying
++ * information: Portions Copyright [yyyy] [name of copyright owner]
++ *
++ * CDDL HEADER END
++ */
++
++/*
++ * Copyright (C) 2015 Jörg Thalheim.
++ */
++
++#ifndef _ZFS_FS_H
++#define	_ZFS_FS_H
++
++#include <linux/fs.h>
++
++#ifndef HAVE_FILE_INODE
++static inline struct inode *file_inode(const struct file *f)
++{
++    return f->f_dentry->d_inode;
++}
++#endif /* HAVE_FILE_INODE */
++
++#endif /* _ZFS_FS_H */
+diff --git a/include/sys/zpl.h b/include/sys/zpl.h
+index 3fc5d97..20eb27b 100644
+--- a/include/sys/zpl.h
++++ b/include/sys/zpl.h
+@@ -31,6 +31,7 @@
+ #include <linux/exportfs.h>
+ #include <linux/falloc.h>
+ #include <linux/file_compat.h>
++#include <linux/fs_compat.h>
+ #include <linux/task_io_accounting_ops.h>
+ #include <linux/vfs_compat.h>
+ #include <linux/writeback.h>
+diff --git a/module/zfs/zpl_file.c b/module/zfs/zpl_file.c
+index 1f4f219..5f5bbba 100644
+--- a/module/zfs/zpl_file.c
++++ b/module/zfs/zpl_file.c
+@@ -617,7 +617,7 @@ zpl_fallocate(struct file *filp, int mode, loff_t offset, loff_t len)
+ static int
+ zpl_ioctl_getflags(struct file *filp, void __user *arg)
+ {
+-	struct inode *ip = filp->f_dentry->d_inode;
++	struct inode *ip = file_inode(filp);
+ 	unsigned int ioctl_flags = 0;
+ 	uint64_t zfs_flags = ITOZ(ip)->z_pflags;
+ 	int error;
+@@ -653,7 +653,7 @@ zpl_ioctl_getflags(struct file *filp, void __user *arg)
+ static int
+ zpl_ioctl_setflags(struct file *filp, void __user *arg)
+ {
+-	struct inode	*ip = filp->f_dentry->d_inode;
++	struct inode	*ip = file_inode(filp);
+ 	uint64_t	zfs_flags = ITOZ(ip)->z_pflags;
+ 	unsigned int	ioctl_flags;
+ 	cred_t		*cr = CRED();
diff --git a/pkgs/os-specific/linux/zfs/bc151f7b312dea09c6ec5b9a320e65140789643a.patch b/pkgs/os-specific/linux/zfs/bc151f7b312dea09c6ec5b9a320e65140789643a.patch
deleted file mode 100644
index 382c8ce63eea..000000000000
--- a/pkgs/os-specific/linux/zfs/bc151f7b312dea09c6ec5b9a320e65140789643a.patch
+++ /dev/null
@@ -1,84 +0,0 @@
-From bc151f7b312dea09c6ec5b9a320e65140789643a Mon Sep 17 00:00:00 2001
-From: Ned Bass <bass6@llnl.gov>
-Date: Thu, 16 Oct 2014 13:52:56 -0700
-Subject: [PATCH] Remove checks for mandatory locks
-
-The Linux VFS handles mandatory locks generically so we shouldn't
-need to check for conflicting locks in zfs_read(), zfs_write(), or
-zfs_freesp().  Linux 3.18 removed the lock_may_read() and
-lock_may_write() interfaces which we were relying on for this
-purpose.  Rather than emulating those interfaces we remove the
-redundant checks.
-
-Signed-off-by: Ned Bass <bass6@llnl.gov>
-Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
-Closes #2804
----
- module/zfs/zfs_vnops.c | 18 ------------------
- module/zfs/zfs_znode.c | 10 ----------
- 2 files changed, 28 deletions(-)
-
-diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
-index 33f9e0e..2f55e56 100644
---- a/module/zfs/zfs_vnops.c
-+++ b/module/zfs/zfs_vnops.c
-@@ -474,15 +474,6 @@ zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
- 	}
- 
- 	/*
--	 * Check for mandatory locks
--	 */
--	if (mandatory_lock(ip) &&
--	    !lock_may_read(ip, uio->uio_loffset, uio->uio_resid)) {
--		ZFS_EXIT(zsb);
--		return (SET_ERROR(EAGAIN));
--	}
--
--	/*
- 	 * If we're in FRSYNC mode, sync out this znode before reading it.
- 	 */
- 	if (ioflag & FRSYNC || zsb->z_os->os_sync == ZFS_SYNC_ALWAYS)
-@@ -651,15 +642,6 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
- 	}
- 
- 	/*
--	 * Check for mandatory locks before calling zfs_range_lock()
--	 * in order to prevent a deadlock with locks set via fcntl().
--	 */
--	if (mandatory_lock(ip) && !lock_may_write(ip, woff, n)) {
--		ZFS_EXIT(zsb);
--		return (SET_ERROR(EAGAIN));
--	}
--
--	/*
- 	 * Pre-fault the pages to ensure slow (eg NFS) pages
- 	 * don't hold up txg.
- 	 * Skip this if uio contains loaned arc_buf.
-diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c
-index 90dbfd3..f02c021 100644
---- a/module/zfs/zfs_znode.c
-+++ b/module/zfs/zfs_znode.c
-@@ -1546,7 +1546,6 @@ zfs_trunc(znode_t *zp, uint64_t end)
- int
- zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)
- {
--	struct inode *ip = ZTOI(zp);
- 	dmu_tx_t *tx;
- 	zfs_sb_t *zsb = ZTOZSB(zp);
- 	zilog_t *zilog = zsb->z_log;
-@@ -1567,15 +1566,6 @@ zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)
- 		goto out;
- 	}
- 
--	/*
--	 * Check for any locks in the region to be freed.
--	 */
--	if (ip->i_flock && mandatory_lock(ip)) {
--		uint64_t length = (len ? len : zp->z_size - off);
--		if (!lock_may_write(ip, off, length))
--			return (SET_ERROR(EAGAIN));
--	}
--
- 	if (len == 0) {
- 		error = zfs_trunc(zp, off);
- 	} else {
diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix
index 3661137fc295..11b77c3d66f4 100644
--- a/pkgs/os-specific/linux/zfs/default.nix
+++ b/pkgs/os-specific/linux/zfs/default.nix
@@ -1,7 +1,6 @@
-{ stdenv, fetchFromGitHub, kernel, spl, perl, autoconf, automake, libtool, zlib, libuuid, coreutils, utillinux }:
+{ callPackage, fetchFromGitHub, ... } @ args:
 
-stdenv.mkDerivation rec {
-  name = "zfs-${version}-${kernel.version}";
+callPackage ./generic.nix (args // rec {
   version = "0.6.3-1.2";
 
   src = fetchFromGitHub {
@@ -15,64 +14,4 @@ stdenv.mkDerivation rec {
     ./mount_zfs_prefix.patch
     ./nix-build.patch # Remove in >=0.6.4
   ];
-
-  buildInputs = [ spl perl autoconf automake libtool zlib libuuid coreutils ];
-
-  # for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work
-  NIX_CFLAGS_LINK = "-lgcc_s";
-
-  preConfigure = ''
-    substituteInPlace ./module/zfs/zfs_ctldir.c   --replace "umount -t zfs"           "${utillinux}/bin/umount -t zfs"
-    substituteInPlace ./module/zfs/zfs_ctldir.c   --replace "mount -t zfs"            "${utillinux}/bin/mount -t zfs"
-    substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/umount"             "${utillinux}/bin/umount"
-    substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/mount"              "${utillinux}/bin/mount"
-    substituteInPlace ./udev/rules.d/*            --replace "/lib/udev/vdev_id"       "$out/lib/udev/vdev_id"
-    substituteInPlace ./cmd/ztest/ztest.c         --replace "/usr/sbin/ztest"         "$out/sbin/ztest"
-    substituteInPlace ./cmd/ztest/ztest.c         --replace "/usr/sbin/zdb"           "$out/sbin/zdb"
-    substituteInPlace ./config/user-systemd.m4    --replace "/usr/lib/modules-load.d" "$out/etc/modules-load.d"
-    substituteInPlace ./config/zfs-build.m4       --replace "\$sysconfdir/init.d"     "$out/etc/init.d"
-    substituteInPlace ./etc/zfs/Makefile.am       --replace "\$(sysconfdir)"          "$out/etc"
-    substituteInPlace ./cmd/zed/Makefile.am       --replace "\$(sysconfdir)"          "$out/etc"
-
-    ./autogen.sh
-  '';
-
-  configureFlags = [
-    "--enable-systemd"
-    "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
-    "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
-    "--with-spl=${spl}/libexec/spl"
-    "--with-dracutdir=$(out)/lib/dracut"
-    "--with-udevdir=$(out)/lib/udev"
-    "--with-systemdunitdir=$(out)/etc/systemd/system"
-    "--with-systemdpresetdir=$(out)/etc/systemd/system-preset"
-    "--sysconfdir=/etc"
-    "--localstatedir=/var"
-  ];
-
-  enableParallelBuilding = true;
-
-  # Remove provided services as they are buggy
-  postInstall = ''
-    rm $out/etc/systemd/system/zfs-import-*.service
-
-    sed -i '/zfs-import-scan.service/d' $out/etc/systemd/system/*
-
-    for i in $out/etc/systemd/system/*; do
-      substituteInPlace $i --replace "zfs-import-cache.service" "zfs-import.target"
-    done
-  '';
-
-  meta = {
-    description = "ZFS Filesystem Linux Kernel module";
-    longDescription = ''
-      ZFS is a filesystem that combines a logical volume manager with a
-      Copy-On-Write filesystem with data integrity detection and repair,
-      snapshotting, cloning, block devices, deduplication, and more.
-      '';
-    homepage = http://zfsonlinux.org/;
-    license = stdenv.lib.licenses.cddl;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ jcumming wizeman ];
-  };
-}
+})
diff --git a/pkgs/os-specific/linux/zfs/generic.nix b/pkgs/os-specific/linux/zfs/generic.nix
new file mode 100644
index 000000000000..ba3884a5e9ba
--- /dev/null
+++ b/pkgs/os-specific/linux/zfs/generic.nix
@@ -0,0 +1,94 @@
+{ stdenv, fetchFromGitHub, autoconf, automake, libtool, utillinux
+, configFile ? "all"
+
+# Userspace dependencies
+, zlib, libuuid, python
+
+# Kernel dependencies
+, kernel ? null, spl ? null
+
+# Version specific settings
+, version, src, patches
+, ...
+}:
+
+with stdenv.lib;
+let
+  buildKernel = any (n: n == configFile) [ "kernel" "all" ];
+  buildUser = any (n: n == configFile) [ "user" "all" ];
+in
+
+assert any (n: n == configFile) [ "kernel" "user" "all" ];
+assert buildKernel -> kernel != null && spl != null;
+
+stdenv.mkDerivation rec {
+  name = "zfs-${configFile}-${version}${optionalString buildKernel "-${kernel.version}"}";
+
+  inherit version src patches;
+
+  buildInputs = [ autoconf automake libtool ]
+    ++ optionals buildKernel [ spl ]
+    ++ optionals buildUser [ zlib libuuid python ];
+
+  # for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work
+  NIX_CFLAGS_LINK = "-lgcc_s";
+
+  preConfigure = ''
+    substituteInPlace ./module/zfs/zfs_ctldir.c   --replace "umount -t zfs"           "${utillinux}/bin/umount -t zfs"
+    substituteInPlace ./module/zfs/zfs_ctldir.c   --replace "mount -t zfs"            "${utillinux}/bin/mount -t zfs"
+    substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/umount"             "${utillinux}/bin/umount"
+    substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/mount"              "${utillinux}/bin/mount"
+    substituteInPlace ./udev/rules.d/*            --replace "/lib/udev/vdev_id"       "$out/lib/udev/vdev_id"
+    substituteInPlace ./cmd/ztest/ztest.c         --replace "/usr/sbin/ztest"         "$out/sbin/ztest"
+    substituteInPlace ./cmd/ztest/ztest.c         --replace "/usr/sbin/zdb"           "$out/sbin/zdb"
+    substituteInPlace ./config/user-systemd.m4    --replace "/usr/lib/modules-load.d" "$out/etc/modules-load.d"
+    substituteInPlace ./config/zfs-build.m4       --replace "\$sysconfdir/init.d"     "$out/etc/init.d"
+    substituteInPlace ./etc/zfs/Makefile.am       --replace "\$(sysconfdir)"          "$out/etc"
+    substituteInPlace ./cmd/zed/Makefile.am       --replace "\$(sysconfdir)"          "$out/etc"
+    substituteInPlace ./module/Makefile.in        --replace "/bin/cp"                 "cp"
+
+    ./autogen.sh
+  '';
+
+  configureFlags = [
+    "--with-config=${configFile}"
+  ] ++ optionals buildUser [
+    "--with-dracutdir=$(out)/lib/dracut"
+    "--with-udevdir=$(out)/lib/udev"
+    "--with-systemdunitdir=$(out)/etc/systemd/system"
+    "--with-systemdpresetdir=$(out)/etc/systemd/system-preset"
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+    "--enable-systemd"
+  ] ++ optionals buildKernel [
+    "--with-spl=${spl}/libexec/spl"
+    "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
+    "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
+  ];
+
+  enableParallelBuilding = true;
+
+  # Remove provided services as they are buggy
+  postInstall = optionalString buildUser ''
+    rm $out/etc/systemd/system/zfs-import-*.service
+
+    sed -i '/zfs-import-scan.service/d' $out/etc/systemd/system/*
+
+    for i in $out/etc/systemd/system/*; do
+      substituteInPlace $i --replace "zfs-import-cache.service" "zfs-import.target"
+    done
+  '';
+
+  meta = {
+    description = "ZFS Filesystem Linux Kernel module";
+    longDescription = ''
+      ZFS is a filesystem that combines a logical volume manager with a
+      Copy-On-Write filesystem with data integrity detection and repair,
+      snapshotting, cloning, block devices, deduplication, and more.
+      '';
+    homepage = http://zfsonlinux.org/;
+    license = licenses.cddl;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ jcumming wizeman wkennington ];
+  };
+}
diff --git a/pkgs/os-specific/linux/zfs/git.nix b/pkgs/os-specific/linux/zfs/git.nix
index fde5310deed2..da48880ae16d 100644
--- a/pkgs/os-specific/linux/zfs/git.nix
+++ b/pkgs/os-specific/linux/zfs/git.nix
@@ -1,73 +1,18 @@
-{ stdenv, fetchgit, kernel, spl_git, perl, autoconf, automake, libtool, zlib, libuuid, coreutils, utillinux }:
+{ callPackage, fetchgit, spl_git, ... } @ args:
 
-stdenv.mkDerivation {
-  name = "zfs-0.6.3-${kernel.version}";
+callPackage ./generic.nix (args // rec {
+  version = "33b4de5";
 
   src = fetchgit {
     url = git://github.com/zfsonlinux/zfs.git;
-    rev = "07dabd234dd51a1e5adc5bd21cddf5b5fdc70732";
-    sha256 = "1yqsfdhyzh33aisfvwqd692n5kfgnlz7yjixd2gqn8vx9bv0dz0b";
+    rev = "33b4de513ee81c2a87e1b954a9544a5eec1f8f94";
+    sha256 = "07kdml65l22z1xi8jif5hr7zr7a8mykyms4f5yrf8nyad20kp6il";
   };
 
-  patches = [ ./mount_zfs_prefix.patch ./nix-build.patch ./bc151f7b312dea09c6ec5b9a320e65140789643a.patch ];
-
-  buildInputs = [ spl_git perl autoconf automake libtool zlib libuuid coreutils ];
-
-  # for zdb to get the rpath to libgcc_s, needed for pthread_cancel to work
-  NIX_CFLAGS_LINK = "-lgcc_s";
-
-  preConfigure = ''
-    substituteInPlace ./module/zfs/zfs_ctldir.c   --replace "umount -t zfs"           "${utillinux}/bin/umount -t zfs"
-    substituteInPlace ./module/zfs/zfs_ctldir.c   --replace "mount -t zfs"            "${utillinux}/bin/mount -t zfs"
-    substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/umount"             "${utillinux}/bin/umount"
-    substituteInPlace ./lib/libzfs/libzfs_mount.c --replace "/bin/mount"              "${utillinux}/bin/mount"
-    substituteInPlace ./udev/rules.d/*            --replace "/lib/udev/vdev_id"       "$out/lib/udev/vdev_id"
-    substituteInPlace ./cmd/ztest/ztest.c         --replace "/usr/sbin/ztest"         "$out/sbin/ztest"
-    substituteInPlace ./cmd/ztest/ztest.c         --replace "/usr/sbin/zdb"           "$out/sbin/zdb"
-    substituteInPlace ./config/user-systemd.m4    --replace "/usr/lib/modules-load.d" "$out/etc/modules-load.d"
-    substituteInPlace ./config/zfs-build.m4       --replace "\$sysconfdir/init.d"     "$out/etc/init.d"
-    substituteInPlace ./etc/zfs/Makefile.am       --replace "\$(sysconfdir)"          "$out/etc"
-    substituteInPlace ./cmd/zed/Makefile.am       --replace "\$(sysconfdir)"          "$out/etc"
-
-    ./autogen.sh
-  '';
-
-  configureFlags = [
-    "--enable-systemd"
-    "--with-linux=${kernel.dev}/lib/modules/${kernel.modDirVersion}/source"
-    "--with-linux-obj=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
-    "--with-spl=${spl_git}/libexec/spl"
-    "--with-dracutdir=$(out)/lib/dracut"
-    "--with-udevdir=$(out)/lib/udev"
-    "--with-systemdunitdir=$(out)/etc/systemd/system"
-    "--with-systemdpresetdir=$(out)/etc/systemd/system-preset"
-    "--sysconfdir=/etc"
-    "--localstatedir=/var"
+  patches = [
+    ./nix-build-git.patch
+    ./3.19-compat-git.patch # Remove once PR-3084 is mainlined
   ];
 
-  enableParallelBuilding = true;
-
-  # Remove provided services as they are buggy
-  postInstall = ''
-    rm $out/etc/systemd/system/zfs-import-*.service
-
-    sed -i '/zfs-import-scan.service/d' $out/etc/systemd/system/*
-
-    for i in $out/etc/systemd/system/*; do
-      substituteInPlace $i --replace "zfs-import-cache.service" "zfs-import.target"
-    done
-  '';
-
-  meta = {
-    description = "ZFS Filesystem Linux Kernel module";
-    longDescription = ''
-      ZFS is a filesystem that combines a logical volume manager with a
-      Copy-On-Write filesystem with data integrity detection and repair,
-      snapshotting, cloning, block devices, deduplication, and more.
-      '';
-    homepage = http://zfsonlinux.org/;
-    license = stdenv.lib.licenses.cddl;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ wizeman ];
-  };
-}
+  spl = spl_git;
+})
diff --git a/pkgs/os-specific/linux/zfs/nix-build-git.patch b/pkgs/os-specific/linux/zfs/nix-build-git.patch
new file mode 100644
index 000000000000..ae8e82f703af
--- /dev/null
+++ b/pkgs/os-specific/linux/zfs/nix-build-git.patch
@@ -0,0 +1,133 @@
+diff --git a/Makefile.am b/Makefile.am
+index 49b417a..f4af44d 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -12,10 +12,10 @@ endif
+ if CONFIG_KERNEL
+ SUBDIRS += module
+ 
+-extradir = @prefix@/src/zfs-$(VERSION)
++extradir = @prefix@/libexec/zfs-$(VERSION)
+ extra_HEADERS = zfs.release.in zfs_config.h.in
+ 
+-kerneldir = @prefix@/src/zfs-$(VERSION)/$(LINUX_VERSION)
++kerneldir = @prefix@/zfs-$(VERSION)/$(LINUX_VERSION)
+ nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
+ endif
+ 
+diff --git a/include/Makefile.am b/include/Makefile.am
+index a94cad5..a160fe2 100644
+--- a/include/Makefile.am
++++ b/include/Makefile.am
+@@ -29,6 +29,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
+ endif
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/zfs-$(VERSION)/include
++kerneldir = @prefix@/include
+ kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+ endif
+diff --git a/include/linux/Makefile.am b/include/linux/Makefile.am
+index d00b1c8..3242d2e 100644
+--- a/include/linux/Makefile.am
++++ b/include/linux/Makefile.am
+@@ -17,6 +17,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
+ endif
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/zfs-$(VERSION)/include/linux
++kerneldir = @prefix@/include/linux
+ kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+ endif
+diff --git a/include/sys/Makefile.am b/include/sys/Makefile.am
+index 7ddace0..8da3870 100644
+--- a/include/sys/Makefile.am
++++ b/include/sys/Makefile.am
+@@ -102,6 +102,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
+ endif
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys
++kerneldir = @prefix@/include/sys
+ kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+ endif
+diff --git a/include/sys/fm/Makefile.am b/include/sys/fm/Makefile.am
+index 8bca5d8..a5eafcd 100644
+--- a/include/sys/fm/Makefile.am
++++ b/include/sys/fm/Makefile.am
+@@ -16,6 +16,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
+ endif
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fm
++kerneldir = @prefix@/include/sys/fm
+ kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+ endif
+diff --git a/include/sys/fm/fs/Makefile.am b/include/sys/fm/fs/Makefile.am
+index fdc9eb5..807c47c 100644
+--- a/include/sys/fm/fs/Makefile.am
++++ b/include/sys/fm/fs/Makefile.am
+@@ -13,6 +13,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
+ endif
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fm/fs
++kerneldir = @prefix@/include/sys/fm/fs
+ kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+ endif
+diff --git a/include/sys/fs/Makefile.am b/include/sys/fs/Makefile.am
+index 0859b9f..b0c6eec 100644
+--- a/include/sys/fs/Makefile.am
++++ b/include/sys/fs/Makefile.am
+@@ -13,6 +13,6 @@ libzfs_HEADERS = $(COMMON_H) $(USER_H)
+ endif
+ 
+ if CONFIG_KERNEL
+-kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fs
++kerneldir = @prefix@/include/sys/fs
+ kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+ endif
+diff --git a/module/Makefile.in b/module/Makefile.in
+index 686402b..9cbf598 100644
+--- a/module/Makefile.in
++++ b/module/Makefile.in
+@@ -18,9 +18,9 @@ modules:
+ 	@# installed devel headers, or they may be in the module
+ 	@# subdirectory when building against the spl source tree.
+ 	@if [ -f @SPL_OBJ@/@SPL_SYMBOLS@ ]; then \
+-		/bin/cp @SPL_OBJ@/@SPL_SYMBOLS@ .; \
++		cp @SPL_OBJ@/@SPL_SYMBOLS@ .; \
+ 	elif [ -f @SPL_OBJ@/module/@SPL_SYMBOLS@ ]; then \
+-		/bin/cp @SPL_OBJ@/module/@SPL_SYMBOLS@ .; \
++		cp @SPL_OBJ@/module/@SPL_SYMBOLS@ .; \
+ 	else \
+ 		echo -e "\n" \
+ 		"*** Missing spl symbols ensure you have built the spl:\n" \
+@@ -28,6 +28,8 @@ modules:
+ 		"*** - @SPL_OBJ@/module/@SPL_SYMBOLS@\n"; \
+ 		exit 1; \
+ 	fi
++	@# when copying a file out of the nix store, we need to make it writable again. 
++	chmod +w @SPL_SYMBOLS@
+ 	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` @KERNELMAKE_PARAMS@ CONFIG_ZFS=m $@
+ 
+ clean:
+@@ -42,15 +44,15 @@ clean:
+ modules_install:
+ 	@# Install the kernel modules
+ 	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` $@ \
+-		INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \
++		INSTALL_MOD_PATH=@prefix@/$(INSTALL_MOD_PATH) \
+ 		INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
+ 		KERNELRELEASE=@LINUX_VERSION@
+ 	@# Remove extraneous build products when packaging
+-	kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
++	kmoddir=@prefix@/$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
+ 	if [ -n $$kmoddir ]; then \
+ 		find $$kmoddir -name 'modules.*' | xargs $(RM); \
+ 	fi
+-	sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
++	sysmap=@prefix@/$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
+ 	if [ -f $$sysmap ]; then \
+ 		depmod -ae -F $$sysmap @LINUX_VERSION@; \
+ 	fi
diff --git a/pkgs/os-specific/linux/zfs/remove-lock-checks.patch b/pkgs/os-specific/linux/zfs/remove-lock-checks.patch
deleted file mode 100644
index 1261b49ee1d4..000000000000
--- a/pkgs/os-specific/linux/zfs/remove-lock-checks.patch
+++ /dev/null
@@ -1,64 +0,0 @@
-diff --git a/module/zfs/zfs_vnops.c b/module/zfs/zfs_vnops.c
-index 33f9e0e..2f55e56 100644
---- a/module/zfs/zfs_vnops.c
-+++ b/module/zfs/zfs_vnops.c
-@@ -474,15 +474,6 @@ zfs_read(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
- 	}
- 
- 	/*
--	 * Check for mandatory locks
--	 */
--	if (mandatory_lock(ip) &&
--	    !lock_may_read(ip, uio->uio_loffset, uio->uio_resid)) {
--		ZFS_EXIT(zsb);
--		return (SET_ERROR(EAGAIN));
--	}
--
--	/*
- 	 * If we're in FRSYNC mode, sync out this znode before reading it.
- 	 */
- 	if (ioflag & FRSYNC || zsb->z_os->os_sync == ZFS_SYNC_ALWAYS)
-@@ -651,15 +642,6 @@ zfs_write(struct inode *ip, uio_t *uio, int ioflag, cred_t *cr)
- 	}
- 
- 	/*
--	 * Check for mandatory locks before calling zfs_range_lock()
--	 * in order to prevent a deadlock with locks set via fcntl().
--	 */
--	if (mandatory_lock(ip) && !lock_may_write(ip, woff, n)) {
--		ZFS_EXIT(zsb);
--		return (SET_ERROR(EAGAIN));
--	}
--
--	/*
- 	 * Pre-fault the pages to ensure slow (eg NFS) pages
- 	 * don't hold up txg.
- 	 * Skip this if uio contains loaned arc_buf.
-diff --git a/module/zfs/zfs_znode.c b/module/zfs/zfs_znode.c
-index 90dbfd3..f02c021 100644
---- a/module/zfs/zfs_znode.c
-+++ b/module/zfs/zfs_znode.c
-@@ -1546,7 +1546,6 @@ zfs_trunc(znode_t *zp, uint64_t end)
- int
- zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)
- {
--	struct inode *ip = ZTOI(zp);
- 	dmu_tx_t *tx;
- 	zfs_sb_t *zsb = ZTOZSB(zp);
- 	zilog_t *zilog = zsb->z_log;
-@@ -1567,15 +1566,6 @@ zfs_freesp(znode_t *zp, uint64_t off, uint64_t len, int flag, boolean_t log)
- 		goto out;
- 	}
- 
--	/*
--	 * Check for any locks in the region to be freed.
--	 */
--	if (ip->i_flock && mandatory_lock(ip)) {
--		uint64_t length = (len ? len : zp->z_size - off);
--		if (!lock_may_write(ip, off, length))
--			return (SET_ERROR(EAGAIN));
--	}
--
- 	if (len == 0) {
- 		error = zfs_trunc(zp, off);
- 	} else {