Skip to content

Instantly share code, notes, and snippets.

@tcheneau
Created April 21, 2025 16:10
Show Gist options
  • Select an option

  • Save tcheneau/75a9cb4166b0e898429cbd1b71eaa505 to your computer and use it in GitHub Desktop.

Select an option

Save tcheneau/75a9cb4166b0e898429cbd1b71eaa505 to your computer and use it in GitHub Desktop.
Building and running ebiten based golang programs on NixOS
{ pkgs ? import <nixpkgs> {} }:
# run nix-shell to initialize the environment
pkgs.mkShell {
# nativeBuildInputs is usually what you want -- tools you need to run
nativeBuildInputs = with pkgs.buildPackages; [ xorg.libX11 xorg.libXcursor xorg.libXrandr xorg.libXinerama xorg.libXi xorg.libXext libGL xorg.libXxf86vm ];
shellHook = "EBITENGINE_LIBGL=\"${pkgs.libGL}/lib/libGL.so\"; export EBITENGINE_LIBGL; EBITENGINE_LIBGLESv2=\"${pkgs.libGL}/lib/libGLESv2.so\"; export EBITENGINE_LIBGLESv2; export LD_LIBRARY_PATH=\"${pkgs.libGL}/lib:$LD_LIBRARY_PATH\";";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment