Help with NVIDIA driver on GNOME 43 with wayland

When using

services.xserver.videoDrivers = [ "nvidia" ];

hardware.opengl.enable = true;

nixpkgs.config.allowUnfree = true;

services.xserver.enable = true;

services.xserver.displayManager.gdm.enable = true;

services.xserver.desktopManager.gnome.enable = true;

after nixos-rebuild switch and rebooting it only loads the tty and after a few seconds just displays a blinking cursor and no interactivity. I have to reboot and boot into an earlier generation.

What could be the problem?

EDIT: The GPU is a GTX 660Ti

My config mirrors your, other than I am using sddm rather than gdm, so should work. I seem to remember catching this a long time ago - I can’t remember if it was switching from KDE to Gnome, or tinkering with

services.xserver.videoDrivers = [ “nvidia” ];
Do any of those apply? You can leave the above empty and it will go through the default list - that might be worth a try?

You probably need the legacy drivers then.

Thank you for the tip.
It worked with this line added to the configuration.nix:

# Optionally, you may need to select the appropriate driver version for your specific GPU.
  hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.legacy_470;