We consider the steady flow driven by turbulent mixing in a benthic boundary layer along a sloping boundary in the general case of a non-uniform background density gradient. The velocity and density fields are decomposed into barotropic and baroclinic components, and a solution is obtained by taking an expansion in the small parameter A, the aspect ratio of the boundary layer defined as the thickness divided by the alongslope length. The flow in the boundary layer is governed by a balance between alongslope baroclinic and barotropic density fluxes. A number of flow regimes can exist, and we show that in the regimes relevant to lakes and reservoirs, the barotropic flow is divergent and drives an exchange flow between the boundary layer and the interior. This leads to changes in the interior density gradient which are significant when compared to field observations.