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

Commit 62a8415

Browse files
farcallergpestana
authored andcommitted
Update the nix build configuration. (#13706)
* 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. * Also add the top level flake for hacking on the substrate as whole * Remove the envrc and ignore it instead. * Remove the top-level configuration --------- Co-authored-by: parity-processbot <>
1 parent 8e54835 commit 62a8415

File tree

7 files changed

+86
-37
lines changed

7 files changed

+86
-37
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ rls*.log
2626
*.iml
2727
bin/node-template/Cargo.lock
2828
substrate.code-workspace
29+
.direnv/
30+
/.envrc

bin/node-template/.envrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
use flake

bin/node-template/README.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,10 @@ Instead of installing dependencies and building this source directly, consider t
153153

154154
### Nix
155155

156-
Install [nix](https://nixos.org/), and optionally [direnv](https://github.com/direnv/direnv) and [lorri](https://github.com/nix-community/lorri) for a fully plug-and-play experience for setting up the development environment.
157-
To get all the correct dependencies, activate direnv `direnv allow` and lorri `lorri shell`.
156+
Install [nix](https://nixos.org/) and
157+
[nix-direnv](https://github.com/nix-community/nix-direnv) for a fully plug-and-play
158+
experience for setting up the development environment.
159+
To get all the correct dependencies, activate direnv `direnv allow`.
158160

159161
### Docker
160162

bin/node-template/flake.lock

+43
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/node-template/flake.nix

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
];
18+
19+
LIBCLANG_PATH = "${pkgs.libclang.lib}/lib";
20+
};
21+
});
22+
}

bin/node-template/rust-toolchain.toml

+14
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

-35
This file was deleted.

0 commit comments

Comments
 (0)