The cool thing about Nix is that everything is compiled into a big immutable content-addressed store. Then switching the configuration is a matter of ensuring if that particular config has been built and switching some symlinks to the right place in the store.