Skip to content

Commit 53c5d45

Browse files
committed
Get working nix environment for this repo
1 parent 4abba9a commit 53c5d45

File tree

5 files changed

+4131
-0
lines changed

5 files changed

+4131
-0
lines changed

.envrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

flake.lock

Lines changed: 92 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
inputs = {
3+
flake-utils.url = "github:numtide/flake-utils";
4+
rust-overlay.url = "github:oxalica/rust-overlay";
5+
};
6+
7+
outputs = { self, nixpkgs, flake-utils, rust-overlay }:
8+
flake-utils.lib.eachDefaultSystem (system:
9+
let
10+
overlays = [ (import rust-overlay) ];
11+
pkgs = import nixpkgs { inherit system overlays; };
12+
rusttoolchain =
13+
pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
14+
# wasm-bindgen = pkgs.rustPlatform.buildRustPackage rec {
15+
# pname = "wasm-bindgen";
16+
# version = "0.2.93";
17+
18+
# nativeBuildInputs = with pkgs; [ pkg-config ];
19+
20+
# src = pkgs.fetchCrate {
21+
# inherit pname version;
22+
# hash = "sha256-LatHkqF6y+XtY2S/6KJWOjmkB5NcKKfmrhEWmAACLMM=";
23+
# };
24+
25+
# cargoLock.lockFile = ./wasm-bindgen-Cargo.lock;
26+
# cargoLock.outputHashes = {
27+
# "raytracer-0.1.0" = "sha256-k6emdBDunYK4pUxrwJCbm57LzICj+q4bRAJ/XJ0zsg0=";
28+
# "weedle-0.13.0" = "sha256-S/AzZmEPamYt0vT6eM8fxnZmXWXwV1DLxVlLIYemZYc=";
29+
# };
30+
# cargoPatches = [
31+
# ./wasm-bindgen-Cargo.lock
32+
# ];
33+
34+
# cargoHash = "";
35+
# };
36+
in
37+
{
38+
devShell = pkgs.mkShell {
39+
buildInputs = with pkgs; [
40+
nodejs-18_x
41+
protobuf
42+
(yarn.override { nodejs = nodejs-18_x; })
43+
rusttoolchain
44+
pkg-config
45+
wasm-bindgen-cli
46+
];
47+
};
48+
});
49+
}

rust-toolchain.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[toolchain]
2+
profile = "default"
3+
channel = "1.80.0"
4+
components = ["rust-src", "rust-analyzer"]
5+
targets = [ "wasm32-unknown-unknown" ]

0 commit comments

Comments
 (0)