Ceiling Mount Power Cable Pass Through
Stick a box and receptacle in the ceiling and plug the thing in there

This is a job for an old work type box mounted in the ceiling, with a receptacle mounted in the old work box.  That way, you'll be covered under NEC 400.7(A) point 2 which allows flexible cord to be used to wire luminaires, instead of violating NEC 400.8 point 2 which prohibits running flexible cordage through building surfaces.

If your device doesn't have a plug on it, get a field-fit type of NEMA 5-15 plug from the hardware store and put that on the end of the cord.

Powering the receptacle then can be done using a chapter 3 wiring method (such as NM) run through the attic to a box where constant power (always-hot and neutral) are present, such as the receptacle box pointed out in your photo.