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

Update the nix build configuration. #13706

Merged
merged 5 commits into from
May 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ rls*.log
*.iml
bin/node-template/Cargo.lock
substrate.code-workspace
.direnv/
/.envrc
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
6 changes: 4 additions & 2 deletions bin/node-template/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,10 @@ Instead of installing dependencies and building this source directly, consider t

### Nix

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.
To get all the correct dependencies, activate direnv `direnv allow` and lorri `lorri shell`.
Install [nix](https://nixos.org/) and
[nix-direnv](https://github.com/nix-community/nix-direnv) for a fully plug-and-play
experience for setting up the development environment.
To get all the correct dependencies, activate direnv `direnv allow`.

### Docker

Expand Down
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.

22 changes: 22 additions & 0 deletions bin/node-template/flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
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 {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

devenv can be used here. it also generates Codespace on demand and more sembles home-manager/nixos config. but this is good too.

Copy link
Contributor Author

@farcaller farcaller Mar 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks! wrong comment

I'll look into it in the next PR if that's alright. I want to add the buildable into the flake as well and it's a bit tricky to do right with a sandbox right now.

packages = with pkgs; [
rustup
clang
protobuf
];

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.