My experience with Nix was a real pleasure, and a complete failure.

I set out with the goal of building a development environment for a software I was working on. I thought - Nix sounds like a better Docker, where it's possible to choose package versions independently of the rest of the system. It's perfect for testing!

I found the package description language refreshing - it was powerful without getting too complicated. Over the course of a couple of days I was able to adapt a few packages and create my own too, with the build environment.

It was almost finished, but the last problem remained: installing CUDA and the userspace portion of the Nvidia driver. It's not rocket science – I thought – all I need is a few .so's, it even works with Docker.

Alas, after battling Nix for another couple of days, trying to use generic GL, installing the Nvidia one, ignoring it altogether or trying to using the host version - I gave up. I found no way to build a package linked against OpenGL that would actually work.

Despite that, I hope to use Nix with a different project in the future.

Here are some links that might help you to get OpenGL work with nix programs on non-NixOS machines:

* https://github.com/NixOS/nixpkgs/issues/9415#issuecomment-30...

* https://github.com/guibou/nixGL

* https://github.com/deepfire/nix-install-vendor-gl