Hello,
I was in the same situation. Not married with baby on the way and my Boyfriend wanting the baby to take his name.
Swiss law states that out of wedlock, the baby takes the mums name but as my boyfriend was also English they accepted english law and after lots of paperwork at the local Etat Civile office in Nyon we had a paper stating that the baby could be named after the dad. This had to be done
BEFORE the baby is born though.If not it would not be possible.
At the hospital after the birth they didn't know about this exception to the rule

and had to call the lady at the Etat Civile just to make sure. So for the first day in the hospital the baby was named with my name. Luckily by the next day and our departure from hospital it was all sorted and the birth certificate was correct

.
If your boyfriend is a swiss guy, this exception may not be possible. I think that both mum and dad have to be from countries that have this agreement with the swiss authorities for it to be possible.
Check with your local Etat Civil. Good luck