diff --git a/default.nix b/default.nix
index cb9a7c5e12debd199c494fc8a6ea60041bdb2e10..9689f6b286b497d837fde5a640e12ed6cb44ccc5 100644
--- a/default.nix
+++ b/default.nix
@@ -11,7 +11,7 @@ let
   #   niv add input-output-hk/haskell.nix -n haskellNix
 
   # Import nixpkgs and pass the haskell.nix provided nixpkgsArgs
-  pkgs' = import
+  pkgs = import
     # haskell.nix provides access to the nixpkgs pins which are used by our CI,
     # hence you will be more likely to get cache hits when using these.
     # But you can also just use your own, e.g. '<nixpkgs>'.
@@ -19,14 +19,14 @@ let
     # These arguments passed to nixpkgs, include some patches and also
     # the haskell.nix functionality itself as an overlay.
     haskellNix.nixpkgsArgs;
-
-  # Help it find the non-Haskell dependency libchallenge_bypass_ristretto_ffi.
-  pkgs = pkgs'.appendOverlays [(import ./oldnix/overlay.nix)];
 in pkgs.haskell-nix.project {
   # 'cleanGit' cleans a source directory based on the files known by git
   src = pkgs.haskell-nix.haskellLib.cleanGit {
     name = "PaymentServer";
     src = ./.;
   };
-  modules = [];
+  modules = [{
+    # Help it find the non-Haskell dependency libchallenge_bypass_ristretto_ffi.
+    pkgs = pkgs.extend (import ./oldnix/overlay.nix);
+  }];
 }