This is an experimental Nix project for integrating the most interesting / important projects in the Ethereum ecosystem as Nix packages / NixOS modules.
Many of the packages found here will be added to nixpkgs
repository once they're stable / mature enough. But for some others, more experimental ones, they can reside here.
This project is developed entirely in Nix Flakes.
As a flake (recommended)
{
inputs = {
ethereum-nix = {
url = "github:nix-community/ethereum.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "nixpkgs/nixos-unstable";
};
outputs = { self, ethereum-nix, nixpkgs }: {
nixosConfigurations.nixos = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
({ pkgs, ... }: {
nixpkgs.overlays = [ ethereum-nix.overlays.default ];
})
];
};
};
}
As an overlay
# configuration.nix
{ pkgs, ... }: {
nixpkgs.overlays = [
(import "${fetchTarball "https://github.com/nix-community/ethereum.nix/archive/main.tar.gz"}/overlays.nix")
];
environment.systemPackages = with pkgs; [
teku
lighthouse
# <...>
];
}
If you're on NixOS, chances are you know what you're doing. If you don't have installed direnv
, clone this repository and when entering inside the folder, just execute nix develop
. It will load a devShell
environment ready to be used.
Optional: install direnv, so whenever you enter inside the directory, it will run nix develop
for you automatically.
To get started, run the following:
$ curl -L https://nixos.org/nix/install | sh
- Clone this repository and when entering inside the folder, just execute
nix develop
. It will load adevShell
environment ready to be used.
Optional: install direnv, so whenever you enter inside the directory, it will run nix develop
for you automatically.
Nobody wants to memorize complex inputs for doing things in the terminal. For that reason, we use just
as a command runner to save and run common tasks. By just
writing:
just
It will describe available commands (commands are defined in it's respective Justfile
, so have a look)!
Formatting will be run via pre-commit
hook if you are in the nix shell
, otherwise you can manually format using the format
command like so:
just fmt
Note: every command has a local and a remote variant. The local variant requires that the command is run from within the cloned repo. The remote variant can be run from wherever.
Local: nix run .#my-app-name
Remote: nix run github:nix-community/ethereum.nix#my-app-name
For brevity and consistency, all the commands are listed in the local variant
- prysm:
- beacon-chain:
nix run .#prysm-beacon-chain
- client-stats:
nix run .#prysm-client-stats
- prysmctl:
nix run .#prysm-ctl
- validator:
nix run .#prysm-validator
- beacon-chain:
- teku:
nix run .#teku
- lighthouse:
nix run .#lighthouse
- besu:
nix run .#besu
- erigon:
nix run .#erigon
- geth:
- abidump:
nix run .#abidump
- abigen:
nix run .#abigen
- bootnode:
nix run .#bootnode
- clef:
nix run .#clef
- devp2p:
nix run .#devp2p
- ethkey:
nix run .#ethkey
- evm:
nix run .#evm
- faucet:
nix run .#faucet
- geth:
nix run .#geth
- rlpdump:
nix run .#rlpdump
- abidump:
- mev-geth:
nix run .#mev-geth
- mev-boost:
nix run .#mev-boost
- ethdo:
nix run .#ethdo
Some crypto projects may need specific libraries to be available to compile properly. Below you can find the list of included ones:
We welcome any kind of contribution or support to this project but before to do so:
- Make sure you have read the contribution guide for more details on how to submit a good PR (pull request).
In addition you can always:
- Add a GitHub Star 🌟 to the project.
- Tweet about this project.
This project has been inspired by the awesome work of:
-
cosmos.nix
by Informal Systems which this repository takes inspiration on it's README and several other places. -
willruggiano on his work done in
eth-nix
repository that served as the initial kick-start for working on this project.