In Norway you get to choose your high school after middle school, all the pupils in a region is ranked solely based on their grades from middle school and for the ones who are sick of books they can go to a more trade-oriented high school (training to become a mechanic, electrician, etc). Obviously it is not perfect and in the district the choices can be quite limited, but it definitely prevents the stereotypical American high school.
Taking my school as an example it was pretty much filled with nerds, many being active in politics, math competitions, etc. I remember very well it being the first time no-one in the class wanted to do football in PE.
Some people criticize it for being worse for the students who don't do well in middle school and end up with very little choices and also separating stronger students. But for the stronger students it so nice with everybody being at least somewhat interested in learning and the teachers being very relaxed.