summaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorFreya Murphy <freya@freyacat.org>2025-10-31 13:15:37 -0400
committerFreya Murphy <freya@freyacat.org>2025-10-31 13:28:29 -0400
commit4d9044c6596cdf99d323c4dd1fcdf0e0d7c8549a (patch)
tree1fe4a53f449e692727cfc5bd584e31801dd3b297 /flake.nix
parentdungeon: remove unused rand_chacha (diff)
downloadDungeonCrawl-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.nix42
1 files changed, 27 insertions, 15 deletions
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";
};