- gcc5 definition: https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/...
- Old cc wrapper with a custom libc option https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/...
- libc in the GCC package itself: https://github.com/NixOS/nixpkgs/blob/master/pkgs/developmen...
The whole system is very modular and customizable. But yeah, very hackish and undocumented.