diff --git a/pkgs/os-specific/linux/spl/default.nix b/pkgs/os-specific/linux/spl/default.nix
index d8714d9c1729..bf435cc862c1 100644
--- a/pkgs/os-specific/linux/spl/default.nix
+++ b/pkgs/os-specific/linux/spl/default.nix
@@ -1,5 +1,5 @@
 { fetchFromGitHub, stdenv, autoreconfHook, coreutils, gawk
-
+, fetchpatch
 # Kernel dependencies
 , kernel
 }:
@@ -10,13 +10,13 @@ assert kernel != null;
 
 stdenv.mkDerivation rec {
   name = "spl-${version}-${kernel.version}";
-  version = "0.7.12";
+  version = "0.7.13";
 
   src = fetchFromGitHub {
     owner = "zfsonlinux";
     repo = "spl";
     rev = "spl-${version}";
-    sha256 = "13zqh1g132g63zv54l3bsg5kras9mllkx9wvlnfs13chfr7vpp4p";
+    sha256 = "1rzqgiszy8ad2gx20577azp1y5jgad0907slfzl5y2zb05jgaipa";
   };
 
   patches = [ ./install_prefix.patch ];
diff --git a/pkgs/os-specific/linux/spl/install_prefix.patch b/pkgs/os-specific/linux/spl/install_prefix.patch
index 114ca1231470..566aab828ef7 100644
--- a/pkgs/os-specific/linux/spl/install_prefix.patch
+++ b/pkgs/os-specific/linux/spl/install_prefix.patch
@@ -136,14 +136,12 @@ index 7faab0a..8148b3d 100644
 +kerneldir = @prefix@/libexec/spl/include/vm
  kernel_HEADERS = $(KERNEL_H)
  endif
-diff --git a/module/Makefile.in b/module/Makefile.in
-index d4e62e1..73fa01c 100644
 --- a/module/Makefile.in
 +++ b/module/Makefile.in
-@@ -21,15 +21,15 @@ clean:
+@@ -21,22 +21,22 @@
  modules_install:
  	@# Install the kernel modules
- 	$(MAKE) -C @LINUX_OBJ@ SUBDIRS=`pwd` $@ \
+ 	$(MAKE) -C @LINUX_OBJ@ M=`pwd` $@ \
 -		INSTALL_MOD_PATH=$(DESTDIR)$(INSTALL_MOD_PATH) \
 +		INSTALL_MOD_PATH=@prefix@/$(INSTALL_MOD_PATH) \
  		INSTALL_MOD_DIR=$(INSTALL_MOD_DIR) \
@@ -160,3 +158,11 @@ index d4e62e1..73fa01c 100644
  	if [ -f $$sysmap ]; then \
  		depmod -ae -F $$sysmap @LINUX_VERSION@; \
  	fi
+ 
+ modules_uninstall:
+ 	@# Uninstall the kernel modules
+-	kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@
++	kmoddir=@prefix@/$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@
+ 	list='$(subdir-m)'; for subdir in $$list; do \
+ 		$(RM) -R $$kmoddir/$(INSTALL_MOD_DIR)/$$subdir; \
+ 	done
diff --git a/pkgs/os-specific/linux/zfs/default.nix b/pkgs/os-specific/linux/zfs/default.nix
index 73be13e17afe..28a4836bf00e 100644
--- a/pkgs/os-specific/linux/zfs/default.nix
+++ b/pkgs/os-specific/linux/zfs/default.nix
@@ -159,17 +159,18 @@ in {
   # to be adapted
   zfsStable = common {
     # comment/uncomment if breaking kernel versions are known
-    incompatibleKernelVersion = "4.20";
+    # incompatibleKernelVersion = "4.20";
 
     # this package should point to the latest release.
-    version = "0.7.12";
+    version = "0.7.13";
 
-    sha256 = "1j432nb3a86isghdysir9xi6l5djmb5fbc5s9zr0rwg4ziisskbh";
+    sha256 = "1l77bq7pvc54vl15pnrjd0njgpf00qjzy0x85dpfh5jxng84x1fb";
 
     extraPatches = [
+      # in case this gets out of date, just send Mic92 a pull request!
       (fetchpatch {
-        url = "https://github.com/Mic92/zfs/compare/zfs-0.7.0-rc3...nixos-zfs-0.7.0-rc3.patch";
-        sha256 = "1vlw98v8xvi8qapzl1jwm69qmfslwnbg3ry1lmacndaxnyckkvhh";
+        url = "https://github.com/Mic92/zfs/commit/cf23c1d38bfc698a8a729fc0c5f9ca41591f4d95.patch";
+        sha256 = "14v3x9ipvg2qd1vyf70nv909jd5zdxlsw5y8k60pfyvwm7g80wr5";
       })
     ];
 
@@ -187,6 +188,7 @@ in {
     isUnstable = true;
 
     extraPatches = [
+      # in case this gets out of date, just send Mic92 a pull request!
       (fetchpatch {
         url = "https://github.com/Mic92/zfs/commit/bc29b5783da0af2c80c85126a1831ce1d52bfb69.patch";
         sha256 = "1sdcr1w2jp3djpwlf1f91hrxxmc34q0jl388smdkxh5n5bpw5gzw";