I am not a complete nerd, maybe 60% nerd, but most of the companies I apply have complete nerds.
Do I need to be a total nerd to work smoothly in a company, how important is cultural fit for companies?
The culture of a company is embedded deeply in the actions and behaviors of it's leaders and employees. Generally speaking, you want to be aligned with the culture of your organization.
As companies get larger, and more teams are added, the culture tends to evolve and specific team cultures can develop - but can still be grounded in the core values of the company.
E.g., the Finance department may have a different culture relative to the Development team. A region-specific team (let's say in a different part of the country / world) may have a different culture.
So to summarize, 1) I would do diligence on the core values of the company you are considering and ensure you are aligned with those and 2) identify the team that you want to be part of and ensure the culture is in line with how you are wired.
As a software developer (which I assume you are referring to), you will find places where they expect absolute nerds. I'd run.
You'll also find places full with boring old farts. I'd find that boring.
A decent place will gladly accept people showing adult behaviour with a life outside computers. And will have people who have a beyond average knowledge and interest in technical matters while being interested in other things as well.
Cultural fit is important - but in a good place a wide range of cultures will be considered "fitting". If you get the feeling that you need to be a complete nerd (or a complete bore) to fit, look elsewhere. And I'd say that even if you fit in that place, because it's just not good for you.