NVIDIA
For Optimus hybrid graphics there are currently two solutions available under NixOS:
1. Bumblebee
Use
hardware.bumblebee.enable = true;
option.
Pros: out of box experience, just start the game via primusrun or optirun wrapper
Cons: some performance penalty, no Vulkan support, things like CUDA and OpenCL are problematic to configure
2. Nvidia PRIME
Use the special script for out of box experience.
There are still some rough edges noted on the top of script, but otherwise it works fine for me.
Similar to Bumblebee, start the game via "primerun.sh".
Vulkan is supported.