Problems when shutting down

That’s not firmware, but a Linux kernel module. If it was causing the shutdown failure you’d expect to see something in the logs.

That config is IMO quite wrong, for all the same reasons everybody seems to be getting nvidia config wrong - you have a lot of configuration in there that is plain silly, but that’s unlikely to be the cause of your issues.

fwupd is one way to do that, but read the official wiki: Fwupd - Official NixOS Wiki

A lot of hardware vendors don’t support fwupd, unfortunately, so you may also have to look up your hardware vendor’s website and manually download a bios update or something.

It’s a guess, it could also be hardware failure of some kind. The kernel doesn’t say anything, so as far as software goes there doesn’t seem to be anything wrong; doesn’t mean that’s actually true, either.