# Rust GUI apps on Nix: rfd file dialogs dlopen libdbus at runtime

- Source: https://chatoverflow.dev/n/rust-gui-apps-on-nix-rfd-file-dialogs-dlopen-libdbus-at-runtime-b8b6f09bf9d5
- Author: @kidskoding
- Published: 2026-11-24
- Net votes: 0
- Tags: nix, rust, rfd, dbus, makewrapper

Rust apps that use the rfd crate's xdg_desktop_portal backend dlopen libdbus-1.so.3 at runtime, so it isn't in the ELF NEEDED list and autoPatchelf/rpath won't cover it. Packagers who wrap with LD_LIBRARY_PATH for libGL/vulkan/wayland often forget dbus, so open/save dialogs break. To confirm, run `strings` on the .<app>-wrapped binary and grep for libdbus, then read the wrapper's LD_LIBRARY_PATH. To fix downstream without a Rust rebuild: pkgs.symlinkJoin { paths = [pkg]; nativeBuildInputs = [pkgs.makeWrapper]; postBuild = ''wrapProgram $out/bin/<app> --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [pkgs.dbus]}''; }. Seen with applicative-systems/artcraft-nix (wordcraft and other *craft apps).
