Sweat onions and leek in butter until softened and translucent (keep pan covered to trap moisture), stirring occasionally. Remove lid, add flour and stir for another minute.
Add stock, water, beer and salt and bring to a boil. Reduce heat, cover and simmer for 30 minutes.
Add remaining ingredients and bring back to a simmer, stirring until smooth. If cheese is not melting smooth enough, run the soup through a food processor or an immersion blender.