pinakes/nix/shell.nix
NotAShelf 57f440d62e
nix: add wasm32-wasip1 target
Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: I4bfc9e9749c17b6950b5489fa42d43c26a6a6964
2026-03-08 15:16:59 +03:00

68 lines
1.8 KiB
Nix

{
lib,
pkgs,
rust-bin,
}: let
inherit (pkgs.rustc) llvmPackages;
# Dioxus desktop dependencies (GTK/WebKit)
runtimeDeps = [
pkgs.pkg-config
pkgs.glib
pkgs.gtk3
pkgs.webkitgtk_4_1
pkgs.libsoup_3
pkgs.cairo
pkgs.pango
pkgs.gdk-pixbuf
pkgs.atk
pkgs.xdotool # provides libxdo
pkgs.openssl
pkgs.kdePackages.wayland
pkgs.libiconv
];
in
pkgs.mkShell {
name = "pinakes-dev";
packages =
[
pkgs.taplo # TOML formatter
pkgs.lldb # debugger
pkgs.llvm
# Modern, LLVM based linking pipelime
llvmPackages.lld
llvmPackages.clang
# Additional Cargo Tooling
pkgs.cargo-nextest
pkgs.cargo-deny
# Build tools
# We use the rust-overlay to get the stable Rust toolchain for various targets.
# This is not exactly necessary, but it allows for compiling for various targets
# with the least amount of friction.
(rust-bin.nightly.latest.default.override {
extensions = ["rustfmt" "rust-src" "rust-analyzer" "clippy" "rust-analyzer"];
targets = ["wasm32-unknown-unknown" "wasm32-wasip1"]; # web + plugins
})
# Handy CLI for packaging Dioxus apps and such
pkgs.dioxus-cli
]
++ runtimeDeps;
env = {
# Allow Cargo to use lld and clang properly
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
RUSTFLAGS = "-C link-arg=-fuse-ld=lld";
# 'cargo llvm-cov' reads these environment variables to find these
# binaries, which are needed to run the tests.
LLVM_COV = "${llvmPackages.llvm}/bin/llvm-cov";
LLVM_PROFDATA = "${llvmPackages.llvm}/bin/llvm-profdata";
# Runtime library path for GTK/WebKit/xdotool
LD_LIBRARY_PATH = "${lib.makeLibraryPath runtimeDeps}";
};
}