Skip to content

Instantly share code, notes, and snippets.

@niklaskorz
Last active December 30, 2025 11:33
Show Gist options
  • Select an option

  • Save niklaskorz/a45c47546636fef295370791efeab8c3 to your computer and use it in GitHub Desktop.

Select an option

Save niklaskorz/a45c47546636fef295370791efeab8c3 to your computer and use it in GitHub Desktop.
dioxus-native nix development shell
{
pkgs ? import <nixpkgs> { },
}:
let
inherit (pkgs) lib;
inherit (pkgs.stdenv.hostPlatform) isLinux;
runtimeDeps = lib.optionals isLinux (
with pkgs;
[
# winit
libxkbcommon
wayland
# wgpu
vulkan-loader
# parley system fonts
fontconfig
]
);
in
pkgs.mkShell {
packages =
(with pkgs; [
# Rust
cargo
cargo-edit
rustc
rustfmt
clippy
rust-analyzer
# dioxus
dioxus-cli
])
++ lib.optionals isLinux (
with pkgs;
[
pkg-config
openssl
]
);
# Required by rust-analyzer
RUST_SRC_PATH = "${pkgs.rustPlatform.rustLibSrc}";
shellHook = lib.optionalString (runtimeDeps != [ ]) ''
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${lib.makeLibraryPath runtimeDeps}";
'';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment