diff options
| author | Freya Murphy <freya@freyacat.org> | 2025-10-31 13:15:37 -0400 |
|---|---|---|
| committer | Freya Murphy <freya@freyacat.org> | 2025-10-31 13:28:29 -0400 |
| commit | 4d9044c6596cdf99d323c4dd1fcdf0e0d7c8549a (patch) | |
| tree | 1fe4a53f449e692727cfc5bd584e31801dd3b297 /flake.nix | |
| parent | dungeon: remove unused rand_chacha (diff) | |
| download | DungeonCrawl-4d9044c6596cdf99d323c4dd1fcdf0e0d7c8549a.tar.gz DungeonCrawl-4d9044c6596cdf99d323c4dd1fcdf0e0d7c8549a.tar.bz2 DungeonCrawl-4d9044c6596cdf99d323c4dd1fcdf0e0d7c8549a.zip | |
Add SDL feature flag (fixes wayland issues)
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"; }; |