diff --git a/flake.nix b/flake.nix index 45f2fd1..f67dba3 100644 --- a/flake.nix +++ b/flake.nix @@ -59,6 +59,34 @@ CARGO_ENCODED_RUSTFLAGS = " "; }; }; + rshell = attrs: rec { + buildInputs = with pkgs; [ + openssl + pkg-config + cmake + zlib + + # common glutin + libxkbcommon + libGL + dbus + + # winit wayland + wayland + + # winit x11 + xorg.libXcursor + xorg.libXrandr + xorg.libXi + xorg.libX11 + ]; + nativeBuildInputs = with pkgs; [ + pkg-config + fontconfig + ]; + LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs; + RUST_SRC_PATH = pkgs.rust.packages.stable.rustPlatform.rustLibSrc; + }; }; }; in diff --git a/nix/devshell/flake-module.nix b/nix/devshell/flake-module.nix index 146490e..84dfaa0 100644 --- a/nix/devshell/flake-module.nix +++ b/nix/devshell/flake-module.nix @@ -13,12 +13,46 @@ # "${inputs.devshell}/extra/language/rust.nix" ]; + devshell = { + name = "rshell devshell"; + + packages = with pkgs; [ + libxkbcommon + libGL + dbus + + wayland + + xorg.libXcursor + xorg.libXrandr + xorg.libXi + xorg.libX11 + openssl + pkg-config + ]; + }; + commands = with pkgs; [ { package = rust-toolchain; category = "rust"; } ]; language.c = { - libraries = lib.optional pkgs.stdenv.isDarwin pkgs.libiconv; + libraries = + (with pkgs; [ + libxkbcommon + libGL + dbus + + wayland + + xorg.libXcursor + xorg.libXrandr + xorg.libXi + xorg.libX11 + openssl + pkg-config + ]) ++ + (lib.optional pkgs.stdenv.isDarwin pkgs.libiconv); }; }; };