From 0775def0892683049ad7ab82e8b062a90fa2edf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Isa=C3=AFe?= Date: Wed, 6 Nov 2024 08:38:35 +0100 Subject: [PATCH] chore: add a `shell.nix` file to handle render libs (#219) --- shell.nix | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 000000000..a0adf5176 --- /dev/null +++ b/shell.nix @@ -0,0 +1,38 @@ +{ pkgs ? import {} }: + +pkgs.mkShell { + buildInputs = with pkgs; [ + # Rust + rustup + # Render tool libs + xorg.libX11 + xorg.libXcursor + xorg.libXi + libxkbcommon + xorg.libxcb + libudev-zero + ]; + + # Render tool libs + LD_LIBRARY_PATH = "$LD_LIBRARY_PATH:${ + with pkgs; + pkgs.lib.makeLibraryPath [ + xorg.libX11 + xorg.libXcursor + xorg.libXi + libxkbcommon + xorg.libxcb + pkgs.vulkan-loader + pkgs.glfw + ] + }"; + + # Shell hook to set up the environment + shellHook = '' + # Initialize rustup if not already done + if [ ! -d "$HOME/.rustup" ]; then + rustup default stable + rustup component add rust-analyzer + fi + ''; +}