https://github.com/aloshy-ai/ethernix
Nix-based development environment for Ethereum smart contract development and testing
https://github.com/aloshy-ai/ethernix
blockchain development ethereum nix smart-contracts solidity web3
Last synced: over 1 year ago
JSON representation
Nix-based development environment for Ethereum smart contract development and testing
- Host: GitHub
- URL: https://github.com/aloshy-ai/ethernix
- Owner: aloshy-ai
- Created: 2025-01-28T17:17:36.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-10T03:46:08.000Z (over 1 year ago)
- Last Synced: 2025-03-10T04:23:00.274Z (over 1 year ago)
- Topics: blockchain, development, ethereum, nix, smart-contracts, solidity, web3
- Language: Nix
- Size: 53.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ETHERNIX
[](https://aloshy.ai)
[](https://github.com/aloshy-ai/ethernix)
[](https://github.com/aloshy-ai/ethernix/actions)
[](https://github.com/aloshy-ai/ethernix)
[](https://opensource.org/licenses/MIT)
A NixOS image builder for Raspberry Pi 4 that provides a streamlined way to create custom NixOS images. Works natively on Apple Silicon (M1/M2/M3) Macs through Docker-based cross-compilation, ensuring seamless build experience across platforms.
## Overview
ETHERNIX simplifies the process of creating NixOS images for Raspberry Pi 4 by providing:
- Declarative NixOS configuration specifically optimized for Raspberry Pi 4
- Automated build pipeline using Devbox
- Pre-configured networking and SSH access
- Essential system utilities pre-installed
- Reproducible builds through Nix
- Native support for Apple Silicon through Docker-based cross-compilation
## System Requirements
- [Devbox](https://www.jetify.com/docs/devbox/installing_devbox) installed
- Container runtime:
- Docker Desktop or Colima with minimum 8GB RAM and 4 CPUs
- Hardware:
- SD Card (minimum 8GB)
- SD Card reader/writer
- Raspberry Pi 4
## Quick Start
1. Clone and enter the repository:
```bash
git clone https://github.com/aloshy-ai/ethernix.git
cd ethernix
```
2. Initialize development environment:
```bash
devbox shell
```
For `direnv` users, run `direnv allow` instead.
3. Generate a secure password hash:
```bash
./scripts/passwdgen.sh
```
4. Configure the user account in `configuration.nix`:
```nix
users.users.admin = {
isNormalUser = true;
extraGroups = [ "wheel" ];
hashedPassword = "your-generated-hash-here";
};
```
5. Build the image:
```bash
devbox run build
```
## SD Card Installation
1. Identify your SD card:
```bash
diskutil list
```
2. Prepare the SD card:
```bash
sudo diskutil unmountDisk /dev/diskN
```
> Replace `diskN` with your SD card's identifier (e.g., `disk6`)
3. Flash the image:
```bash
sudo dd if=out/ethernix.img of=/dev/diskN bs=1M status=progress
```
> ⚠️ **CAUTION**: Double-check the disk identifier to prevent data loss
4. Safely eject:
```bash
sudo sync
sudo diskutil eject /dev/diskN
```
## Initial Setup
1. Insert the SD card and connect your Raspberry Pi 4 to:
- Power supply
- Ethernet cable
- (Optional) Display and keyboard for direct access
2. Access via SSH:
```bash
ssh aloshy@192.168.8.69
```
3. Update system channels:
```bash
sudo nix-channel --add https://nixos.org/channels/nixos-unstable nixos
sudo nix-channel --add https://github.com/nix-community/home-manager/archive/master.tar.gz home-manager
sudo nix-channel --update
```
4. Set up system configuration:
```bash
sudo nixos-generate-config
```
5. Transfer configuration files:
From your development machine:
```bash
scp -i ~/.ssh/id_rsa {flake.nix,configuration.nix} aloshy@192.168.8.69:/tmp/
```
On the Raspberry Pi:
```bash
sudo mv /tmp/{flake.nix,configuration.nix} /etc/nixos/
```
6. Apply the configuration:
```