I'd like to like Nix but I wasn't able to solve myself a simple issue (IMHO the docs aren't very good) and couldn't find help either ( https://www.reddit.com/r/NixOS/comments/4attyh/a_newbie_ques... ) so..
- 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.