From 4d9044c6596cdf99d323c4dd1fcdf0e0d7c8549a Mon Sep 17 00:00:00 2001 From: Freya Murphy Date: Fri, 31 Oct 2025 13:15:37 -0400 Subject: Add SDL feature flag (fixes wayland issues) --- flake.nix | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 88d1256..eca8545 100644 --- a/flake.nix +++ b/flake.nix @@ -30,26 +30,38 @@ xorg.libXinerama xorg.libXcursor xorg.libXi + SDL2 ]; - libPath = lib.makeLibraryPath libs; in { devShell = pkgs.mkShell { - packages = with pkgs; [ - # rust - rustc - rustfmt - rust-analyzer - cargo - clippy - # raylib - cmake - clang - glfw - pkg-config - ] ++ libs; - LD_LIBRARY_PATH = libPath; + packages = with pkgs; + [ + # rust + rustc + rustfmt + rust-analyzer + cargo + clippy + # raylib + cmake + clang + glfw + pkg-config + ] + ++ libs; + + shellHook = '' + # Set SDL video driver + if [ "$XDG_SESSION_TYPE" == "wayland" ]; then + export SDL_VIDEODRIVER=wayland + else + export SDL_VIDEODRIVER=x11 + fi + ''; + + LD_LIBRARY_PATH = lib.makeLibraryPath libs; LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib"; }; -- cgit v1.2.3-freya