Build Methods
Loom supports two build methods:- Nix with cargo2nix (Preferred) - Reproducible builds with per-crate caching
- Cargo (Development) - Standard Rust toolchain builds
Nix builds are significantly faster on incremental changes due to per-crate caching. Use Cargo for quick iteration during development.
Nix Build (Preferred)
Prerequisites
1
Install Nix
Install Nix with flakes enabled:
2
Enable Flakes
Flakes should be enabled by default with the Determinate Systems installer. Verify:
Building Loom
Loom uses cargo2nix for reproducible builds with per-crate caching:cargo2nix Workflow
When you modifyCargo.toml or Cargo.lock:
1
Update Cargo.lock
2
Regenerate Cargo.nix
Cargo.nix with the updated dependency graph.3
Commit Both Files
Cargo Build (Development)
Prerequisites
1
Install Rust
Install Rust using rustup:
2
Verify Installation
Building with Cargo
Full Check
Run all quality checks:cargo fmt --all -- --check- Format verificationcargo clippy --workspace -- -D warnings- Lintingcargo build --workspace- Buildcargo test --workspace- Tests
Build Profiles
Loom uses optimized build profiles:Development Profile
Cargo.toml
Fast Profile
For git hooks and quick iteration:Cargo.toml
Release Profile
Cargo.toml
Loom’s release profile prioritizes fast compilation over runtime performance since deployment uses Nix builds.
Installation Locations
System-wide Installation
- Nix
- Cargo
Add to your
~/.config/nixpkgs/config.nix or NixOS configuration:Development Installation
For development, use the binary directly:Web Frontend
The web UI is built with SvelteKit:1
Install pnpm
2
Install Dependencies
3
Run Development Server
4
Build for Production
Server Deployment
Loom server runs on NixOS with auto-update:NixOS Auto-Update
Deployments happen automatically ongit push to trunk:
- Checks for new commits every 10 seconds
- Rebuilds using Nix when changes detected
- Restarts the
loom-serversystemd service
Verify Deployment
1
Check Deployed Revision
2
Check Service Status
3
View Update Logs
4
Verify Health Endpoint
Force Rebuild
If auto-update is stuck:Database Migrations
All migrations live incrates/loom-server/migrations/:
Adding Migrations
1
Create Migration File
2
Write SQL
crates/loom-server/migrations/025_new_feature.sql
3
Force Rebuild
Migration Testing
Test migrations locally:Troubleshooting
Nix Build Fails
Cargo Build Fails
cargo2nix Out of Sync
If Nix build fails with dependency errors:Next Steps
Quick Start
Start your first REPL session
Configuration
Configure Loom for your environment
Development Guide
Learn about code style, testing, and contributing
Deployment
Deploy Loom server to production