Help setting up Nix shell with python and vulkan

Okay - I’ve made a bit of progress here.

Based on this thread, I modified my mkShell call to be:

mkShell {
    buildInputs = [
        # all the build inputs...
    ]
    LD_LIBRARY_PATH="${vulkan-loader}/lib"
}

This is the simplest thing that appears to find libvulkan.so.1.

BUT, this reveals a new problem. I now get a pygame.error: No available video device.

This appears even when I change model.py to be:

import pygame
pygame.init()
pygame.display.init() # error occurs here
pygame.display.list_modes()

Any clue what in the Nix setup is causing this error?

1 Like