It seems like when my diet is heavy in seafood and the veggies I like; my hair grows much better and is much healthier, my nails and skin look better too.
When I can't afford to eat as I would like, I notice all of those things suffer so I would say diet matters a lot to hair as counter intuitive as that sounds.
Edit: By veggies I like, I mean Artichoke, Spinach, Olives, Asparagus, Brussels Sprouts, Collard Greens, etc. When I am not as well financially though, I end up eating corn, green beans, broccoli, and other much cheaper veggies which don't seem as good for me.