Overlay is not working

Because of some reason my overlays are not working:


let overlays = [(import ./overlay.nix)];
  { pkgs ? import <nixpkgs> {inherit overlays;} }:
    with pkgs;
      let callPackage = lib.callPackageWith haskell.packages.ghc865;
      in callPackage ./pkg.nix {inherit stdenv;}


self0: super0:
    haskellPackages = super0.haskellPackages.extend(
      _: super1: {
        HaskellNet = self0.haskell.lib.doJailbreak super1.HaskellNet;


cabal2nix . > pkg.nix

But when I execute nix-build . I get an error

Configuring HaskellNet-0.5.1...
CallStack (from HasCallStack):
  die', called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:950:20 in Cabal-
  configureFinalizedPackage, called at libraries/Cabal/Cabal/Distribution/Simple/Configure.hs:460:12 in Cabal-
  configure, called at libraries/Cabal/Cabal/Distribution/Simple.hs:596:20 in Cabal-
  confHook, called at libraries/Cabal/Cabal/Distribution/Simple/UserHooks.hs:67:5 in Cabal-
  configureAction, called at libraries/Cabal/Cabal/Distribution/Simple.hs:178:19 in Cabal-
  defaultMainHelper, called at libraries/Cabal/Cabal/Distribution/Simple.hs:115:27 in Cabal-
  defaultMain, called at Setup.hs:2:8 in main:Main
Setup: Encountered missing dependencies:
mime-mail >=0.4.7 && <0.5

The interesting thing is that stack build works just fine