forked from google/tarpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
45 lines (40 loc) · 1.31 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
40
41
42
43
44
45
{
description = "tarpc-wasm";
inputs = {
flake-compat = { url = "github:edolstra/flake-compat"; flake = false; };
nixpkgs = { url = "github:nixos/nixpkgs/nixos-unstable"; };
flake-utils = { url = "github:numtide/flake-utils"; inputs.nixpkgs.follows = "nixpkgs"; };
cargo2nix = { url = "github:cargo2nix/cargo2nix"; inputs.nixpkgs.follows = "nixpkgs"; };
rust-overlay = { url = "github:oxalica/rust-overlay"; inputs = { nixpkgs.follows = "nixpkgs"; flake-utils.follows = "flake-utils"; }; };
};
outputs = { self, nixpkgs, cargo2nix, flake-utils, rust-overlay, ... }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
cargo2nix.overlays.default
rust-overlay.overlays.default
];
};
node_pkg = pkgs.nodejs-18_x.override { enableNpm = false; };
rust = import ./nix/rust.nix {
inherit pkgs;
channel = "nightly";
version = "2022-08-16";
};
in rec {
devShell = pkgs.mkShell rec {
nativeBuildInputs = with pkgs; [
binaryen
cargo-expand
rust.toolchain
wasm-bindgen-cli
wasm-pack
node_pkg
(yarn.override { nodejs = node_pkg; }) # by default yarn uses the latest version of nodejs, so we override it to the correct version here
];
};
}
);
}