diff --git a/shell.nix b/shell.nix
index 82afac579e08b5fe57cd8fb8e787fbdd19e78605..a8d98586540d6feedc13fa9b8d131d05de0e6760 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,14 +1,13 @@
-{ pkgs ? import ./nixpkgs.nix { } }:
 let
-  zkapauthorizer = pkgs.callPackage ./default.nix { };
+  sources = import nix/sources.nix;
 in
-  (pkgs.python27.buildEnv.override {
-    extraLibs = with pkgs.python27Packages; [
-      fixtures
-      testtools
-      hypothesis
-      pyhamcrest
-      zkapauthorizer
-    ];
-    ignoreCollisions = true;
-  }).env
+{ pkgs ? import sources.release2015 {} }:
+  let
+    tests = pkgs.callPackage ./tests.nix {};
+  in
+    pkgs.mkShell {
+      packages = [
+        tests.python
+        pkgs.niv
+      ];
+    }
diff --git a/tests.nix b/tests.nix
index 0ac16ac8fffa8a8f96e7bf5d80092362dd117d45..1bbeb1c57266fcfa77c979b377714d34f566107f 100644
--- a/tests.nix
+++ b/tests.nix
@@ -27,7 +27,11 @@ in
       _.hypothesis.postUnpack = "";
     };
   in
-    pkgs.runCommand "zkapauthorizer-tests" {} ''
+    pkgs.runCommand "zkapauthorizer-tests" {
+      passthru = {
+        inherit python;
+      };
+    } ''
       mkdir -p $out
 
       pushd ${zkapauthorizer.src}