Nixos rust iced, can't find Wayland library error

Hello,
I wanted to try the iced library for rust, but when I try to run the programm (it builds perfectly fine) using cargo run I get the error
thread 'main' panicked at /home/florian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/iced_winit-0.13.0/src/program.rs:192:10: Create event loop: Os(OsError { line: 81, file: "/home/florian/.cargo/registry/src/index.crates.io-6f17d22bba15001f/winit-0.30.9/src/platform_impl/linux/wayland/event_loop/mod.rs", error: WaylandError(Connection(NoWaylandLib)) }) note: run with RUST_BACKTRACE=1 environment variable to display a backtrace.
So my question is, if it is possible to simply run the programm using cargo run or do I have to build the project into a nix os package everytime.
Thank you very much
masterflo3004

The dependencies of iced tend to dlopen stuff (e.g. wayland-rs). You need to run the program inside a nix-shell:

1 Like

thank you very much. I will try this.

Not a single day goes by without Rust people being embarrassingly bad at dealing with graphics libraries. I took some time to improve their devShell, see here:

PR to upstream repo

4 Likes