I haven’t used Ansible but it sounds pretty much like that, basically you write out all the packages you want in a config and it builds the system from that. Very nice in terms of stability and maintainability. I’m very much an amateur so I can’t say for sure but I think the unused package issue would still exist on nix.
I mean netcode for pc-to-pc games at least isn’t really rocket science. I’m not as familiar with the crossplay aspect, but I’d hazard a guess that it is only difficult because console manufacturers have locked multiplayer networking behind their own subscription services. I can understand why they went the route they did, but maybe crossplay is overvalued if the cost is stuff like this.