A rule of thumb for Apple is they support the current OS version, plus the 2 preceding versions. Mavericks (10.9) is the last supported version, and any machine that shipped with it is still viable.
As a note, Google is dropping Chrome support for Mountain Lion (10.8.5) in April, at the same time they are dropping it for XP and Vista.
Here is a list of El Capitan compatible machines, which should give you an idea of the oldest machine you should buy.
iMac (Mid-2007 or later)
MacBook (13-inch Aluminum, Late 2008), (13-inch, Early 2009 or later)
MacBook Pro (13-inch, Mid-2009 or later), (15-inch, Mid/Late 2007 or later), (17-inch, Late 2007 or later)
MacBook Air (Late 2008 or later)
Mac Mini (Early 2009 or later)
Mac Pro (Early 2008 or later)
Xserve (Early 2009)
And, btw, I love the Mini. My various clients have over 250 of them, and we install more all the time. The laptop drives Apple uses were not really up to working in a desktop environment, but upgrading them is worth it.
My favorites are the Late 2012, especially if you get them with the i7, but they are hard to come by. The i5's are nice and easily upgradeable.