Welcome to XOC and congrats on your new ride.
Price-wise, you'll generally do ok at Carmax since they advertise their prices as under blue book value. Please don't take offense at what I say next, but going on the fact you asked whether you "did ok", didn't you research prices online before buying? If not, thank Carmax for their fixed price policy 'cause you might have gotten a real good hosing elsewhere. With the research tools available these days, there are no excuses for getting screwed by a car dealer. Have to do your homework.
Good choice on the extended warranty. Carmax would have you believe their vehicles are as good as, say a manufacturer's certified used car. Not always. My daughter bought a Pontiac (domestic vehicle, first mistake) at a Carmax in Houston last year. It had been transferred from another Carmax and after the thing basically started falling apart a couple weeks later, they admitted that somehow neither Carmax store had done the required inspection or any repairs. Under threat of a lawsuit they've replaced the engine (yes, the freakin' ENGINE, it was that bad) and numerous other failed components.
An aberration? Maybe, and at least it didn't take legal action to get them to repair the POS they sold, but while I used to be a big Carmax fan, caveat emptor is now my advice for those considering Carmax.
Again, welcome, and use the search feature freely. Just about any information you could ever want about your Xterra is on XOC somewhere. And rule 1 for newbs, no new threads asking about/bitching about mileage, OK?