forked from arkade-os/rust-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
64 lines (58 loc) · 2.04 KB
/
flake.nix
File metadata and controls
64 lines (58 loc) · 2.04 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{
description = "Development shell for ark-rs";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-stable.url = "github:NixOS/nixpkgs/nixos-24.05";
rust-overlay.url = "github:oxalica/rust-overlay";
flake-utils.url = "github:numtide/flake-utils";
};
outputs = { self, nixpkgs, nixpkgs-stable, rust-overlay, flake-utils, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [ (import rust-overlay) ];
config = {
allowUnfree = true;
};
};
pkgs-stable = import nixpkgs-stable { inherit system; };
rustToolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
rustToolchainWithWasm = rustToolchain.override {
targets = [ "wasm32-unknown-unknown" ];
extensions = [ "rust-src" ];
};
rustBinNightly = (pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal)).override {
extensions = [ "rustfmt" "rust-analyzer" ];
};
# From nightly, we only want to use rusfmt and rust-analyzer. The rest of rustBinNightly is ignored.
rustfmt = rustBinNightly.passthru.availableComponents.rustfmt;
rustAnalyzer = rustBinNightly.passthru.availableComponents.rust-analyzer;
in
{
devShells.default = with pkgs; mkShell {
# TODO: Trim these.
buildInputs = [
binaryen
dprint
gcc
go
jq
llvmPackages_latest.bintools
openssl
pkg-config
postgresql
rustAnalyzer
# Must appear _before_ `rustToolchainWithWasm`.
rustfmt
rustToolchainWithWasm
wabt
wasm-bindgen-cli
wasm-pack
worker-build
];
RUST_SRC_PATH = "${rustToolchainWithWasm}/lib/rustlib/src/rust/library";
};
}
);
}