Firefox memory leak | firefox bad performance on intel integrated graphics

I recently installed nixos on an off-brand laptop from a local manufacturer. Whenever I opened firefox I would start noticing a huge performance drop, as well as memory ramping up (even after killing firefox) until I had to hit the power button as the system deemed unusable. I also noticed a few posts from reddit and nixpkgs github’s issues but none of them seemed to solve the problem

After looking for a while, I found out that firefox was trying to use VAAPI, which was not available in my system.

[GFX1-]: vaapitest: VA-API test failed: failed to initialise VAAPI connection.

Just add the following lines to your configuration.nix

  hardware.opengl.extraPackages = with pkgs; [                                                                                                                              

I’m unaware if this is an nixos specific issue

You may want to try out some nixos-hardware modules, the intel module does this by default, and the CPU ones set some important kernel args:

If there’s no module for your device, the various common modules are quite usable as-is - and you could get started on actually making a module based on those if you have some time.

Edit: Huh, how did I end up on a 2 month old post…