If your using iwd standalone (without NetworkManager and dhcpcd) then you might have tried networking.nameservers = [ "1.1.1.1" ];, but this does not work ![]()
If you cat /etc/resolv.conf then you would see
nameserver 1.1.1.1
nameserver {{ some random dns server here }}
This is because your resolvconf.service has automatically appended a dynamic dns to /etc/resolv.conf. The solution to it is to add to configuration.nix
networking.wireless.iwd.settings.Network.NameResolvingService="none";
resolvconf.enable=false;
resolvconf is enabled by default when you have a /etc/resolv.conf it seems.m