Could not load module ‘System.IO’

Thank you, this fixed the issue on a NixOS 23.05 (stable channel) machine, which packages cabal 3.10.x and ghc 9.2.x

And just for the record, cabal 3.6.2 (with ghc 8.10.7) doesn't have this behavior.