I've hooked up several compressors. I prefer them to kick on only when my key is on.
On my '09, I wired it to a relay that draws current from my trailer charge wire (I believe the larger of the two posts on the main fuse block that generally aren't connected when you first get your truck). If you don't want to draw it from there, you could pull it directly from your battery or the stud post near the alternator.
As far as the "key on" trigger to turn on the relay, I ran off one of the accessories from the under hood fuse box. I can't remember off the top of my head which one... But the relay won't be pulling many amps, so you'd probably be safe with just about anything on there. Just check it with a test light to see what kicks on/off with the key. You can use a "fuse tap." They are available for both regular and mini (ATC, ATO, ATM) fuses. I believe you can find them at AutoZone or similar. They're all over the web, too.
And put a fuse in everything!!
🙂HEREis a great write-up on setting up a relay on NNBS GM pickups.