Note: trying here after no response in general electrical.

I need to run 120V power to a flush-mounted Leviton structured wiring enclosure that will contain satellite/catv equipment.

The power needs to come from a UPS. The enclosure will be mounted in a wall of a wiring closet, the UPS will be in a rack in the same closet.

I'm having trouble figuring out how to do this. If it was a surface mount enclosure I would just run a flexible cord from the receptacle box on the enclosure direct to the UPS.

Because the enclosure is flush mounted, I'm "in wall" so I assume that I need to use NM-B for the in-wall portion of the run, then somehow exit the wall and transition to flexible cord at that point? Seems like a lot of work for a 10 foot wire run.

Just wondering if I'm making this too complicated and there is a better way.