There have been lots of solutions over the years. Here are a few:
1. Premiere's Pete straight truck has the sleeper in the box. Not an uncommon solution, it uses the maximum width of the box. This particular box is built by A.M.Haire of Thomasville NC (they went bankrupt in 2009 and have re-opened as A.M.Haire Phoenix) one of the most popular straight truck moving box companies. They offered the sleeper in the box and a host of other options. In this case the sleeper is probably fairly small, extending about 3 feet into the cargo box area. Photo 2011-10-31.
2. Hope that's not an extra sleeper behind the tilt cab on this Hayes. It's more likely additional storage. COEs offered various size sleepers, and that was one option. August 1984 photo.
3. Your basic dog coffin, which required slithering through the rear window hole, was the most basic option for the conventional cab. This Campbell Brothers IH didn't even have a side door to the sleeper. May 1980 photo.
4. Make a bigger sleeper, with a bunk beds and a side door on the curb side, and an escape hatch on the drivers side. This unmarked AVL contractor got room, but not much help in the aerodynamics. The KW set back gave a bit more length to work with. It has extra fuel tanks for the long hauls. August 1980 photo.
5. Keep going up, and go out over the cab was the solution for D. Armstrong's International. This one had big windows and a penthouse, with interesting bi-level roof. July 1984 photo.
6. Go all the way up and out was the answer on this Kenworth. The only giveway that this is not a cargo drom box, is the little escape hatch from the penthouse, with slanted window. This guy has extra tanks and a super big extra horn on the side of the hood. Maybe he uses that when someone is trying to sleep upstairs. No doubt there is a door and maybe a window on the curb side to access the camper box. August 1982 photo.