I used both in Gnome Boxes and NixOS was around 590mb while Fedora started at 1GB going to 1.3GB after 2 Minutes (while doing nothing apart from Terminal with TOP open). Both the official (recommended) iso. Same on Ubuntu based Distros all above 1GB while Arch based are a below and OpenSUSE Tumbelweed as well but all of them not as significant as NixOS.
I agree with you that NixOS uses much less resources compared to something like Ubuntu. I didn’t specifically check the RAM usage because I have plenty of that but the lesser CPU usage is something that I noticed quite heavily on my VMs. https://www.2li.ch/blog/2022-01-17_switching_to_nixos
Guys, the NixOS VMs must simply be running less in order to be using significantly less RAM and CPU. There are no magic compiler flags that suddenly make things more efficient if you happen to know them.