I have the same issue. There must be a missing or conflicting firewall rule because it works if I stop the firewall. Docker’s firewall rules seems to be added but I’ve not spent the time to figure out what’s wrong and how to fix it.
I just ran into what appears to be the same issue today. I have host.docker.internal set in my /etc/hosts file on NixOS, but the docker containers I am running cannot access it from inside the container. It just works fine for my buddy running the same stack on M1 Mac with docker deskop (and without any Nix stuff).
Did anyone of you two have any luck with finding out the reason? @ivann or @timjnz?
Any luck here? I haven’t seen the issue as I don’t use NixOS much anymore for Docker stuff and haven’t tested anything but I’m curious as I did depend on something like this just the other month and would be dismayed if I could no longer do it on NixOS