How to jailbreak haskell package in shell

From what I understand jail breaking loosens up the version restriction and this is what I did here

openapi3 = super.haskell.lib.dontCheck (super.haskell.lib.doJailbreak (hsuper.openapi3.overrideAttrs (oldAttrs: {
  src = super.fetchFromGitHub {
    owner = "piq9117";
    repo = "openapi3";
    rev = "8e059be4219ab7941ee43da6f2ebdf849810b41c";
    sha256 = "0k2s5azzfwcs6f3k6k3mkwksk5pj2lalyn3a834p9b1z29dc763i";
  };
})));

This totally works when I do nix build. However when I do nix develop and do cabal build all I get version errors

❄ cabal build all
Warning: Requested index-state 2022-06-10T00:00:00Z is newer than
'hackage.haskell.org'! Falling back to older state (2022-06-09T22:11:17Z).
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: openapi3-3.2.2 (user goal)
[__1] next goal: base (dependency of openapi3)
[__1] rejecting: base-4.17.0.0/installed-4.17.0.0 (conflict: openapi3 =>
base>=4.11.1.0 && <4.17)
[__1] rejecting: base-4.16.1.0, base-4.16.0.0, base-4.15.1.0, base-4.15.0.0,
base-4.14.3.0, base-4.14.2.0, base-4.14.1.0, base-4.14.0.0, base-4.13.0.0,
base-4.12.0.0, base-4.11.1.0, base-4.11.0.0, base-4.10.1.0, base-4.10.0.0,
base-4.9.1.0, base-4.9.0.0, base-4.8.2.0, base-4.8.1.0, base-4.8.0.0,
base-4.7.0.2, base-4.7.0.1, base-4.7.0.0, base-4.6.0.1, base-4.6.0.0,
base-4.5.1.0, base-4.5.0.0, base-4.4.1.0, base-4.4.0.0, base-4.3.1.0,
base-4.3.0.0, base-4.2.0.2, base-4.2.0.1, base-4.2.0.0, base-4.1.0.0,
base-4.0.0.0, base-3.0.3.2, base-3.0.3.1 (constraint from non-upgradeable
package requires installed instance)
[__1] fail (backjumping, conflict set: base, openapi3)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: base, openapi3

This is the whole flake file tie/flake.nix at piq9117/flake · piq9117/tie · GitHub

1 Like

Looks like it was my cabal.project that was giving me trouble. I added allow-newer and I was able to build the project in the shell