I’ve done this, works great! I have a 40L model. Remember to keep the exhaust fan unobstructed.
Note: I didn’t go the hardwire route. I found using something like this is flexible, cheap and instant.
Cigarette lighter/USB adapter with on/off switches