Pretty simple to do, although there are several options.
I run a headless Mac Mini, USB out to a PS Audio DirectStream DAC. My main library is stored in an iTunes library on an external Firewire disc. (The USB goes into an Uptone Audio Regen first.)
iTunes is not the best way to play, though. You'd want something like JRiver, Amarra, or as in my case, PureMusic to actually take on the signal processing.
Another option that I employ is to run Roon, but I'd suggest getting the above to work first. Roon seamlessly integrates Tidal (subscription needed) with your iTunes library.
Lots of information on various setups can be found here on Agon.