diff options
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 42 |
1 files changed, 27 insertions, 15 deletions
@@ -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"; }; |