forked from ekzhang/rustpad
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
58 lines (55 loc) · 1.59 KB
/
flake.nix
File metadata and controls
58 lines (55 loc) · 1.59 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
{
description = "LLZero Benchmark Environment";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-25.11";
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, nixpkgs, fenix, ... }:
let
supportedSystems =
[ "aarch64-linux" "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ];
forEachSupportedSystem = f:
nixpkgs.lib.genAttrs supportedSystems (system:
f {
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
});
in {
# Overlay for the Rust toolchain
overlays.default = final: prev: {
rustToolchain =
fenix.packages.${prev.stdenv.hostPlatform.system}.fromToolchainFile {
file = ./rust-toolchain.toml;
sha256 = "sha256-vra6TkHITpwRyA5oBKAHSX0Mi6CBDNQD+ryPSpxFsfg=";
};
};
# Inputs for shell environments
devShells = forEachSupportedSystem ({ pkgs }: {
default = pkgs.mkShell.override { stdenv = pkgs.clangStdenv; } {
buildInputs = with pkgs;
[
rustToolchain
cargo-deny
cargo-edit
cargo-watch
lldb
openssl
wasm-pack
bun
];
env = {
# Rust-analyzer
RUST_SRC_PATH =
"${pkgs.rustToolchain}/lib/rustlib/src/rust/library";
RUST_LOG = "info";
EXPIRY_DAYS = "1";
};
};
});
};
}