Skip to content
This repository has been archived by the owner on Jun 9, 2024. It is now read-only.

Commit

Permalink
build: add nix flake for hermetic dev environments
Browse files Browse the repository at this point in the history
  • Loading branch information
corduroybera committed Jan 18, 2024
1 parent cd96aa6 commit 0f57689
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ If you want to help contribute to the framework, check out the [Framework Specs]

## Build & Test

### Standard Development Environment

[Golang 1.20+](https://go.dev/doc/install) and [Foundry](https://book.getfoundry.sh/getting-started/installation) are required for Polaris.

1. Install [go 1.21+ from the official site](https://go.dev/dl/) or the method of your choice. Ensure that your `GOPATH` and `GOBIN` environment variables are properly set up by using the following commands:
Expand Down Expand Up @@ -97,6 +99,27 @@ If you want to help contribute to the framework, check out the [Framework Specs]
make start
```

### Nix Flakes Development Environment

Polaris also supports reproducible development environments using [Nix](https://nixos.org/) with [Flakes](https://nixos.wiki/wiki/Flakes).

1. Install [Nix](https://github.com/DeterminateSystems/nix-installer). We recommend the Determinate Systems installer to automatically configure your system with Flakes turned on.
2. Clone, Setup and Test:

```sh
cd $HOME
git clone https://github.com/berachain/polaris
cd polaris
git checkout main
nix develop
make test-unit
```
3. Start a local development network:

```sh
make start
```

## 🚧 WARNING: UNDER CONSTRUCTION 🚧

This project is work in progress and subject to frequent changes as we are still working on wiring up the final system.
Expand Down
3 changes: 2 additions & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
devShell = with pkgs; mkShell {
name = "polaris-dev";
nativeBuildInputs = [
gnumake
go
jq
foundry-bin
Expand All @@ -31,4 +32,4 @@
};
}
);
}
}

0 comments on commit 0f57689

Please sign in to comment.