As long as someone pays the shop labor rate - which is $1 per minute in my shop's case - there's really no need for a tip. If it's something small that only takes a minute or two (like installing pedals), and he doesn't charge you, throwing the guy a few bucks won't hurt. Food or beer is a good gesture if you know the guy and what he likes - but not everyone drinks or eats the same things and because you don't already have some sort of relationship set up with the shop/the mechanic, a cash tip will most likely be the best way to go.
A really old guy whose bike I often work on who we call Rumpelstiltskin (his name is Russell Stiltson) always brings a fresh batch of brownies or cookies whenever he comes in, but I've known him forever.