How to access the port of a nixos test VM from the host?

I have figured this out now. Going through the QEMU router and the internal ip 10.0.2.15 instead of localhost works. Will write this up when ready.