From 3e31d791073fb5ed6fcc7fd41ebc3638b20b8b69 Mon Sep 17 00:00:00 2001 From: Sijmen Date: Mon, 22 Aug 2022 21:47:49 +0200 Subject: [PATCH] Add shell.nix --- shell.nix | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..5246963 --- /dev/null +++ b/shell.nix @@ -0,0 +1,33 @@ +let + pkgs = import {}; + + log_level = "info"; +in +pkgs.mkShell { + buildInputs = with pkgs; [ + rustc cargo rustfmt rust-analyzer cargo-outdated clippy + + # Needed by cargo dependencies. + cmake gcc zlib pkgconfig openssl + + # wgpu graphics dependencies + vulkan-loader vulkan-tools + xorg.libXcursor xorg.libXi xorg.libXrandr + + # Linker + lld + + cargo-outdated + ]; + + shellHook = '' + # Dynamic linking for Vulkan stuff for wgpu graphics + export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${ + with pkgs; pkgs.lib.makeLibraryPath [ vulkan-loader openssl zlib ] + }" + ''; + + RUST_BACKTRACE = "1"; + RUSTFLAGS = "-C link-arg=-fuse-ld=lld"; + RUST_LOG = "calx-ecs=${log_level},vitral=${log_level},calx=${log_level},display=${log_level},world=${log_level},magog=${log_level}"; +}