-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathflake.nix
39 lines (37 loc) · 1.05 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, fenix, flake-utils }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
toolchain = with fenix.packages.${system}; combine [
complete.toolchain
targets.wasm32-unknown-unknown.latest.rust-std
];
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
toolchain
pkgs.wasm-pack
pkgs.rust-analyzer
] ++ (with pkgs; [
pkg-config
openssl
# Add LLVM tools for WASM linking
llvmPackages.bintools
]);
RUST_SRC_PATH = "${toolchain}/lib/rustlib/src/rust/library";
# Set the linker for WASM
CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld";
};
}
);
}