DioxusLabs / DioxusLabs/dioxus

Blank window on nixos using Dioxus Native

Open
#5,133 2 comments 0 reactions 0 assignees View on GitHub
bug native nix
Dominant language
Rust
Stars
39.1k
Forks
1.9k
Avg merge
4d 10h
Merged PRs (30d)
4

Description

**Problem**

When trying to run dx serve instead of a proper application I just see a blank window

**Steps To Reproduce**

Steps to reproduce the behavior:

- Use nixos
- Setup a dioxus project using the native target
- Use a flake to set up dependencies:
```nix
{
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};

outputs =
{
nixpkgs,
rust-overlay,
...
}:
let
system = "x86_64-linux";
overlays = [ (import rust-overlay) ];
pkgs = import nixpkgs {
inherit system overlays;
};
in
{
devShells."${system}".default =
pkgs.mkShell.override { stdenv = pkgs.stdenvAdapters.useMoldLinker pkgs.clangStdenv; }
{
packages = with pkgs; [
(rust-bin.stable.latest.default.override {
extensions = [
"rust-src"
"rust-analyzer"
];
})
dioxus-cli
wasm-bindgen-cli
cargo-nextest

pkg-config
openssl
python3
];

RUSTFLAGS =
let
dlopenLibraries = with pkgs; [
wayland
libxkbcommon
vulkan-loader
];
in
"-C link-arg=-Wl,-rpath,${pkgs.lib.makeLibraryPath dlopenLibraries}";
};
};
}
```

**Expected behavior**

A working window

**Screenshots**

Image

**Environment:**

- Dioxus version: v0.7.2
- Rust version: 1.92.0
- OS info: NixOS Unstable
- App platform: native

**Questionnaire**

I'm interested in fixing this myself but don't know where to start.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.