Last active
December 30, 2025 11:33
-
-
Save niklaskorz/a45c47546636fef295370791efeab8c3 to your computer and use it in GitHub Desktop.
dioxus-native nix development shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| 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