In reply to @le:4d2.org
GHC2024 is only supported if you have at least version 9.10 of ghc, according to a warning when initialising projects with cabal. nix installs 9.8.4 by default though.
When I explicitly install a newer version using nix-shell -p cabal-install haskell.compiler.ghc9122, which installs ghc version 9.12.2, it works.
(Well "works": I get a different error, which could be resolved with changing base ^>= 4.19.2.0 to base >= 4.19.2.0 in mandelbrot.cabal, but that's a different topic)
To have all of this in your shell.nix, change
myPkg = pkgs.haskellPackages.callCabal2nix "mandelbrot" src {};
to
myPkg = pkgs.haskell.packages.ghc9122.callCabal2nix "mandelbrot" src {};
|