I've got a wastewater vent stack that is dead-center behind the master bath vanity. (See attached picture.) Previously, there was a single light fixture. You can still see the box, which wasn't mounted to anything and which was off center. (It was a new work box, and I have NO idea what held it in place while they hung drywall. The sheathing on this house is DennyBoard, and it certainly wasn't affixed to that.)
How should I mount a new box in order to be code-compliant? I am in Texas, and my city has recently adopted the 2011 electrical code. I am a homeowner doing my own work under the homestead exemption -- my city would normally require this work to be done by a licensed electrician. Everything I have done so far has passed without modification.
I can either move the soil stack to the side and install a piece of wood, or I might be able to mount something like a ceiling fan box that would allow me to adjust the position of the fixture horizontally, but I'm not sure how to make that work.
Since the circuit already has the maximum number of fixtures on it, I cannot install two light fixtures with one on either side of the soil stack without running a new circuit back to the panel. I can do that, but I'd rather avoid it.
Installing an old work box is not legal according to the inspector since I have the walls open (drywall had to come down to fix other issues.) I didn't ask if I could in theory mount the box to the PVC pipe somehow, but I intensely dislike that idea anyway. He told me, without mincing words, that it was my job to figure out how to do it and his to tell me if I'd done it right or wrong, and if I wasn't sure I should call a real electrician.