Having depression and trying to lead a normal life is very tiring. I hope you can get through this someday.
I am not sure how things in uni work but since you're lonely and most of those around you aren't on good terms with you, how about you find other friends , they don't have to be medics or in uni, anyone you can connect with, or maybe try with your flat mates. actually before you try to befriend others try to befriend yourself, treat yourself well and your stop negative thoughts from controlling you. stop wasting your life and feeling sorry for yourself, i know it's easier said than done but you have to take the first step in order to change your life. go out on walks , show kindness to others, try to think less about how lonely you are and more about how blessed you are to be in uni talking your course. Get to know yourself maybe you're doing something wrong , try to improve your self and don't be afraid to take the initiative in social situations. it'll be hard but as long as you keep trying and never give up , the moment will come when you're happy again and that moment will be worth all the pain.