Beer is 95% water. If you’re counting on it for all your calories, you probably won’t want to drink any additional water or you lose your precious salt and vitamins.
As others have noted vitamin C and salt are probably the most immediate lacking nutrients. If you had a margarita once a week, I think that might be enough.
Numerous people have done a 40-day fast for lent, taking only beer. So that is easily doable. Multiple months is probably possible, but seasons/years maybe not.
With 43 kcal/100ml you need about 4.6 liters or 5 qts to satisfy your caloric needs (2000kcal/day). If you even out the intake over the whole day, alcohol levels should be low enough to keep you functioning. Beer also contains a bit of protein and low levels of sodium, potassium and magnesium.
Long term, you’ll get scurvy after a few months due to lack of vitamin C and liver cirrhosis from the sustained alcohol use.
High malt, low alcohol beers could keep a person surviving for a pretty long time. You would likely run into some deficiencies in certain vitamins eventually, but that would take months to be a problem.
Long enough to get a degree