Maybe using Nix it's a better experience for creating such an environment where you depending also on system utilities.
If you just write straight c++ (without c++xx, or anything like it) you can compile the code on machines from decades ago if you want.
It's like Python 2 vs Python 3 except even worse.