Build from Source

Building from source gives you the latest features and the ability to customize Nexus OS.

Clone the Repository

bash
git clone https://github.com/leonidas-esquire/nexus-os
cd nexus-os

Build

bash
# Debug build (faster compilation, slower runtime)
cargo build

# Release build (slower compilation, optimized runtime)
cargo build --release

Install

bash
# Copy to your PATH
sudo cp target/release/naos /usr/local/bin/

# Or use cargo install
cargo install --path .

Build Options

FlagEffect
--releaseOptimized build (~10MB binary)
--features edgeInclude Cloudflare edge support
--features fullAll features enabled
bash
# Full-featured release build
cargo build --release --features full

Cross-Compilation

Build for a different target:

bash
# Add target
rustup target add x86_64-unknown-linux-musl

# Build static binary
cargo build --release --target x86_64-unknown-linux-musl

Troubleshooting Build Issues

Missing C compiler

bash
# macOS
xcode-select --install

# Ubuntu/Debian
sudo apt install build-essential

# Fedora
sudo dnf install gcc

Rust version too old

bash
rustup update stable