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

nix-shell example? #145

Open
CyberShadow opened this issue Sep 22, 2023 · 1 comment
Open

nix-shell example? #145

CyberShadow opened this issue Sep 22, 2023 · 1 comment

Comments

@CyberShadow
Copy link

Hi, thanks for creating this.

Could you please add an example with nix-shell?

For example, if I'm running an application with nix-shell like this:

NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/7b1777b1e47d730dea558a5cd9b381cdee7b4f14.tar.gz nix-shell -p element-desktop --run element-desktop

How do I modify the above command to run element-desktop via nixGL?

Is a one-liner possible? Or do I have to create a .nix file for every occasion?

Thank you.

@CyberShadow
Copy link
Author

CyberShadow commented May 17, 2024

I figured it out:

export NIX_PATH=nixpkgs=https://github.com/NixOS/nixpkgs/archive/7b1777b1e47d730dea558a5cd9b381cdee7b4f14.tar.gz

$(nix-build https://github.com/nix-community/nixGL/archive/master.tar.gz -A nixGLIntel)/bin/nixGLIntel \
    nix-shell -p element-desktop --run element-desktop

To sum it up:

  1. Prefix the command with the output of $(nix-build URL-to-this-repo-tarball -A nixGLTheFlavorYouWant)/bin/nixGLTheFlavorYouWant
  2. Make sure that nixGL and your application are targeting the same nixpkgs version, otherwise you may get glib version mismatches.

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

1 participant