@@ -83,6 +83,7 @@ hooks =
8383 , ("Cabal >2.2", over (setupDepends . haskell) (Set.union (Set.fromList [self "mtl", self "parsec"]))) -- https://github.com/haskell/cabal/issues/5391
8484 , ("cabal-helper", set doCheck False) -- https://github.com/DanielG/cabal-helper/issues/17
8585 , ("cabal-install", set doCheck False . set phaseOverrides cabalInstallPostInstall)
86+ , ("cabal2nix > 2", cabal2nixOverrides)
8687 , ("darcs", set phaseOverrides darcsInstallPostInstall . set doCheck False)
8788 , ("dbus", set doCheck False) -- don't execute tests that try to access the network
8889 , ("dns", set testTarget "spec") -- don't execute tests that try to access the network
@@ -354,3 +355,11 @@ opencvOverrides = set phaseOverrides "hardeningDisable = [ \"bindnow\" ];"
354355
355356hspecCoreOverrides :: Derivation -> Derivation -- https://github.com/hspec/hspec/issues/330
356357hspecCoreOverrides = set phaseOverrides "testTarget = \"--test-option=--skip --test-option='Test.Hspec.Core.Runner.hspecResult runs specs in parallel'\";"
358+
359+cabal2nixOverrides :: Derivation -> Derivation
360+cabal2nixOverrides = set phaseOverrides $ unlines
361+ [ "preCheck = ''"
362+ , " export PATH=\"$PWD/dist/build/cabal2nix:$PATH\""
363+ , " export HOME=\"$TMPDIR/home\""
364+ , "'';"
365+ ]