diff --git a/flake.lock b/flake.lock
index 9371759..50d257d 100644
--- a/flake.lock
+++ b/flake.lock
@@ -11,11 +11,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1711545796,
-        "narHash": "sha256-SEbDNcd5LrAo1x/mmXhhbL11MK9t8C6oXh4T6/VI5ps=",
+        "lastModified": 1711555668,
+        "narHash": "sha256-0LU71MTTfRdJZcueS4lo9HFBZTxrev9MFOwAJvzLQ9U=",
         "owner": "liesnikov",
         "repo": "agda2hs",
-        "rev": "d576bf5d3672efc65569b8e463e0a199c9a4e887",
+        "rev": "34239074ad061bf0f0f1d087534e7b0263fdebc3",
         "type": "github"
       },
       "original": {
@@ -132,11 +132,11 @@
         ]
       },
       "locked": {
-        "lastModified": 1711546610,
-        "narHash": "sha256-dxugvxuDg3GNRVF2yXXxEKZlNpyVVEbSGg/Z6ilOfUM=",
+        "lastModified": 1711556257,
+        "narHash": "sha256-mhadxb5T6VVxxPy6JqOFEGQoXuJuqYTU7+PWAnKHmnw=",
         "owner": "liesnikov",
         "repo": "scope",
-        "rev": "de0307a8d7c08dae59d94c7372b90ef64bf1662b",
+        "rev": "1007b0b925dc1b8910fa113c697ebd5671518a27",
         "type": "github"
       },
       "original": {
diff --git a/flake.nix b/flake.nix
index 4fd4248..d6a09bd 100644
--- a/flake.nix
+++ b/flake.nix
@@ -24,15 +24,16 @@
         agda2hs-lib = agda2hs.packages.${system}.agda2hs-lib;
         scope-lib = scope.packages.${system}.scope-lib;
 
-        compiler = "ghc96";
-        withCompiler = compiler:
-          let haskellPackages =
-                if compiler == "default"
-                then pkgs.haskellPackages
-                else pkgs.haskell.packages.${compiler};
-              agda2hs-custom = (agda2hs.lib.${system}.withCompiler compiler).withPackages [agda2hs-lib scope-lib];
-          in haskellPackages.callPackage ./nix/agda-core.nix {agda2hs = agda2hs-custom;};
-        agda-core = withCompiler compiler;
+        helper = agda2hs.lib.${system};
+        hpkgs = pkgs.haskell.packages.ghc96;
+        agda2hs-ghc96 = pkgs.callPackage (helper.agda2hs-expr) {
+          inherit self;
+          agda2hs = hpkgs.callPackage (helper.agda2hs-pkg "--jailbreak") {};
+          inherit (hpkgs) ghcWithPackages;
+        };
+        agda2hs-custom = agda2hs-ghc96.withPackages [agda2hs-lib scope-lib];
+        agda-core-pkg = import ./nix/agda-core.nix;
+        agda-core = pkgs.haskellPackages.callPackage ./nix/agda-core.nix {agda2hs = agda2hs-custom;};
       in {
         packages = {
           agda-core-lib = agdaDerivation
@@ -49,7 +50,7 @@
           default = agda-core;
         };
         lib = {
-          inherit withCompiler;
+          inherit agda-core-pkg;
         };
 
         devShells.default = pkgs.haskellPackages.shellFor {