Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate with nixGl #29

Open
tobiasBora opened this issue Aug 31, 2022 · 4 comments
Open

Integrate with nixGl #29

tobiasBora opened this issue Aug 31, 2022 · 4 comments

Comments

@tobiasBora
Copy link

First, thanks for this great program.

When running a program using openGl (e.g. blender) you get an error:

$ nix run github:thiagokokada/nix-alien -- blender
/tmp/blender-3.2.2-linux-x64/blender: error while loading shared libraries: libGL.so.1: cannot open shared object file: No such file or directory

As far as I see the best solution is to use nixGl:

$ nix run --impure github:guibou/nixGL --override-input nixpkgs nixpkgs/nixos-21.11 -- nix run github:thiagokokada/nix-alien -- blender

This does work but it is definitely not super easy to run... It would be great if nix-alien could directly handle openGl correctly.

@thiagokokada
Copy link
Owner

We probably can integrate it in the generated flake.nix file, adding nixGL as the input.

However I have zero experience with nixGL, and I also don't run non-NixOS Linux systems with Nix, so I would be open for a PR here.

@thiagokokada thiagokokada pinned this issue Feb 11, 2023
@soleera
Copy link

soleera commented Jul 4, 2023

nixGL is essentially just a wrapper script that sets a few system-specific environment variables ( e.g. LIBGL_DRIVERS_PATH) before calling a GUI program. One option would be to change the last line of the templates to something like ${__wrapper__} ${__program__} "$@" and then add an optional argument to nix-alien (e.g. nix-alien --wrapper nixGL blender), or we could add an optional argument that allows you to specify the exec command independently (e.g. nix-alien --exec "nixGL blender" blender).

@thiagokokada
Copy link
Owner

nixGL is essentially just a wrapper script that sets a few system-specific environment variables ( e.g. LIBGL_DRIVERS_PATH) before calling a GUI program. One option would be to change the last line of the templates to something like ${__wrapper__} ${__program__} "$@" and then add an optional argument to nix-alien (e.g. nix-alien --wrapper nixGL blender), or we could add an optional argument that allows you to specify the exec command independently (e.g. nix-alien --exec "nixGL blender" blender).

This looks easy to add, but it would assume that the user installed nixGL in a user accessible PATH and that this nixGL matches the current nixpkgs version of the one used by nix-alien right? From what I understood reading the README, this can cause GLIBC errors.

Ideally the integration with nixGL runs deeper. A --nixgl flag could add nixgl to the flake.nix inputs and also properly override it. Not sure what to do with the shell.nix version though, I can either not add this to the non-flake version or just add it and hope for the best.

@thiagokokada
Copy link
Owner

@soleera @tobiasBora Can either of you provide a binary that works with nix-alien+nixGL but doesn't work without it? Like the blender example from OP? The link for download is fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants