This is the most straightforward way if I was not on NixOs.
If I want to change the DNS settings in my nix config, I need internet connection (unless it's possible to rebuild while offline?)
I was trying to bypass this by just changing the DNS server for that specific network connection, but I didn't get it to work. Because it has to use the DNS of the captive portal to be able to load the page