Bumblebee is well-supported in NixOS. My last mobile NVIDIA hardware has died, but I used it Bumblebee on NixOS for years.
https://search.nixos.org/options?channel=22.05&from=0&size=5...
https://search.nixos.org/options?channel=22.05&show=hardware...