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

Commit

Permalink
Update the nix build configuration.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
farcaller committed Mar 25, 2023
1 parent ad66dd2 commit 01432c2
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 35 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ rls*.log
scripts/ci/node-template-release/Cargo.lock
bin/node-template/Cargo.lock
substrate.code-workspace
.direnv/
1 change: 1 addition & 0 deletions bin/node-template/.envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
43 changes: 43 additions & 0 deletions bin/node-template/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 24 additions & 0 deletions bin/node-template/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs = { self, nixpkgs, flake-utils, ... }: flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs { inherit system; };
in
{
devShells.default = pkgs.mkShell {
packages = with pkgs; [
rustup
clang
protobuf
rustfmt
];
shellHook = ''
export LIBCLANG_PATH="${pkgs.libclang.lib}/lib"
'';
};
});
}
14 changes: 14 additions & 0 deletions bin/node-template/rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[toolchain]
channel = "nightly"
components = [
"cargo",
"clippy",
"rust-analyzer",
"rust-src",
"rust-std",
"rustc-dev",
"rustc",
"rustfmt",
]
targets = [ "wasm32-unknown-unknown" ]
profile = "minimal"
35 changes: 0 additions & 35 deletions bin/node-template/shell.nix

This file was deleted.

0 comments on commit 01432c2

Please sign in to comment.