Skip to content

Commit

Permalink
fix: support wayland in nix dev shell
Browse files Browse the repository at this point in the history
iced wants to load a dynamic library for wayland, which doesn't
work on nix if it's not explicitly put into the path. See:
rust-windowing/winit#3244 (comment)
  • Loading branch information
elsirion committed May 31, 2024
1 parent 344df1c commit 682fed5
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
let
overlays = [ rust-overlay.overlays.default ];
pkgs = import nixpkgs { inherit system overlays; };
lib = pkgs.lib;
rust = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
inputs = [
rust
Expand Down Expand Up @@ -57,8 +58,15 @@
};


devShell = pkgs.mkShell {
devShell = pkgs.mkShell rec {
packages = inputs;
buildInputs = with pkgs; [
libxkbcommon
libGL
# WINIT_UNIX_BACKEND=wayland
wayland
];
LD_LIBRARY_PATH = "${lib.makeLibraryPath buildInputs}";
shellHook = ''
export LIBCLANG_PATH=${pkgs.libclang.lib}/lib/
export LD_LIBRARY_PATH=${pkgs.openssl}/lib:$LD_LIBRARY_PATH
Expand Down

0 comments on commit 682fed5

Please sign in to comment.