diff --git a/nix/default.nix b/nix/default.nix
index c6ccaa3bd6e9c312cce48d23eec5531b23dc4d77..9484f9c80ec3b0078666a1e745f4039691a3e370 100644
--- a/nix/default.nix
+++ b/nix/default.nix
@@ -1,9 +1,10 @@
 # paramaterised derivation with dependencies injected (callPackage style)
 { pkgs, stdenv, src ? ../., opam2nix, ocaml ? "ocaml-ng.ocamlPackages_4_08.ocaml", plugins ? { } }:
 
-let opam-selection = {
+let mydir = builtins.getEnv("PWD");
+    opam-selection = {
       inherit ocaml;
-      selection = ./opam-selection.nix;
+      selection = "${mydir}/opam-selection.nix";
     };
     mk_opam_derivations = packages: opam2nix.resolve opam-selection packages;
     opamPackages =