I have a program that requires C++17 support, which gcc7 doesn’t have. Can I force gcc8 for my derivation?
You can use gcc8Stdenv.