Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit 62af566

Browse files
committed
Update the nix build configuration.
Remove the old shell.nix with some legacy versions pinned and replace it with a flake-based shell. It installs rust via rustup instead of fenix to be more generally compatible with the guidelines. This also adds the rust-toolchain.toml spec with all the components required for wasm, and everything else to make rust-analyzer & clippy happy.
1 parent ad66dd2 commit 62af566

File tree

6 files changed

+84
-35
lines changed

6 files changed

+84
-35
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,4 @@ rls*.log
2727
scripts/ci/node-template-release/Cargo.lock
2828
bin/node-template/Cargo.lock
2929
substrate.code-workspace
30+
.direnv/

bin/node-template/.envrc

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

bin/node-template/flake.lock

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

bin/node-template/flake.nix

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
4+
flake-utils.url = "github:numtide/flake-utils";
5+
};
6+
7+
outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
8+
let
9+
pkgs = import nixpkgs { inherit system; };
10+
in
11+
{
12+
devShells.default = pkgs.mkShell {
13+
packages = with pkgs; [
14+
rustup
15+
clang
16+
protobuf
17+
gnumake
18+
rustfmt
19+
];
20+
shellHook = ''
21+
export LIBCLANG_PATH="${pkgs.libclang.lib}/lib"
22+
'';
23+
};
24+
});
25+
}

bin/node-template/rust-toolchain.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[toolchain]
2+
channel = "nightly"
3+
components = [
4+
"cargo",
5+
"clippy",
6+
"rust-analyzer",
7+
"rust-src",
8+
"rust-std",
9+
"rustc-dev",
10+
"rustc",
11+
"rustfmt",
12+
]
13+
targets = [ "wasm32-unknown-unknown" ]
14+
profile = "minimal"

bin/node-template/shell.nix

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)