nixGL icon indicating copy to clipboard operation
nixGL copied to clipboard

`nix-shell` example?

Open CyberShadow opened this issue 2 years ago • 1 comments

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 avatar Sep 22 '23 10:09 CyberShadow

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.

CyberShadow avatar May 17 '24 19:05 CyberShadow