I cant get glfw to work for anything

I keep getting

/home/kingfloch/projects/bot/.devenv/state/venv/lib/python3.11/site-packages/glfw/__init__.py:917: GLFWError: (65542) b'EGL: Failed to get EGL display: Success'
  warnings.warn(message, GLFWError)
Could not initialize Window

when i run my python program. i try to run mine craft also through prism launcher same error. I cant seem to get glfw to work with this os.
It seems like if i want to use glfw, it can’t work with nix shell. I have tried litterally everything. setting the ld library path, add the lib gl and glfw packages nothing seems to work. I dont understand nix shells, if nothing ever links properly. wouldnt i just stick with direnv and arch?