heyarne.aphorisms/shell.nix
arne 21b86ce217 Processing needs xwayland for compatibility
Fixes "CompilerException java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable."
2022-08-28 09:57:36 +02:00

25 lines
811 B
Nix

{ pkgs ? import <nixpkgs> { }, }:
let
lib = pkgs.lib;
in pkgs.mkShell rec {
name = "quil-env";
buildInputs = with pkgs; [
xorg_sys_opengl
xwayland
clojure
];
LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}";
# wayland compat
# see https://discourse.ubuntu.com/t/environment-variables-for-wayland-hackers/12750
WAYLAND_DISPLAY = "no";
DISPLAY = ":0";
_JAVA_AWT_WM_NONREPARENTING = "1";
# we need to make sure the library is on the path for JOGL;
# also, there's a bug that is avoided with the variable
# https://github.com/processing/processing/issues/5476
JAVA_OPTS = "-Djava.library.path=${lib.makeLibraryPath buildInputs} -Djogl.disable.openglcore=true";
# LIBGL_ALWAYS_SOFTWARE = true; # ← this is the same as passing -Djogl.disable.openglcore="true"
}