Kernel panic with Nvidia driver 550 on Laptop Gaming (possible solutions)

Any laptop gaming with RTX graphics card have major issues with the latest nvidia driver starting with version 550. Since NixOS 24.05 provides version 550 it could affect more users who are not aware of this issue.

This version of nvidia causes kernel panic on shutdown, on startup or during upgrade and freezes the entire system until you force to shutdown. When it occurs, the caps lock starts blinking which indicates kernel panic. This started happening on Arch-based distros.

There is a thread about it in the official NVIDIA support website: https://forums.developer.nvidia.com/t/series-550-freezes-laptop/284772

The possible and probably easiest solution is to use 535 which you can add in the config file.

hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.mkDriver {
      version = "535.154.05";
      sha256_64bit = "sha256-fpUGXKprgt6SYRDxSCemGXLrEsIA6GOinp+0eGbqqJg=";
      sha256_aarch64 = "sha256-G0/GiObf/BZMkzzET8HQjdIcvCSqB1uhsinro2HLK9k=";
      openSha256 = "sha256-wvRdHguGLxS0mR06P5Qi++pDJBCF8pJ8hr4T8O6TJIo=";
      settingsSha256 = "sha256-9wqoDEWY4I7weWW05F4igj1Gj9wjHsREFMztfEmqm10=";
      persistencedSha256 = "sha256-d0Q3Lk80JqkS1B54Mahu2yY/WocOqFFbZVBh+ToGhaE=";
    }; 

Remember that this specific version is unknown when it comes to Wayland support and I do not test if it works or not.