Post

Fix NVIDIA GPU Acceleration in Firejailed Firefox on NixOS

Fix NVIDIA GPU Acceleration in Firejailed Firefox on NixOS

If you’re running Firefox through Firejail on NixOS with an NVIDIA GPU, you may notice that hardware acceleration and WebGL are broken. Checking about:support reveals that GPU acceleration is blocked or unavailable.

The Problem

Firejail’s default Firefox profile restricts access to /etc, which prevents Firefox from reading the NVIDIA EGL vendor configuration files it needs to initialise GPU acceleration.

The Fix

Add a local Firejail override for Firefox in your configuration.nix:

1
2
3
environment.etc."firejail/firefox.local".text = ''
  private-etc egl,nvidia
'';

This extends Firejail’s private-etc whitelist to include the egl and nvidia directories, giving Firefox access to the driver config it needs without disabling sandboxing entirely.

After rebuilding (sudo nixos-rebuild switch), relaunch Firefox via Firejail and check about:support — GPU acceleration should now show as available!

This post is licensed under CC BY 4.0 by the author.