This project includes a flake.nix for reproducible development environments using Nix.
-
Install Nix with flakes support:
# Official installer (recommended) curl --proto '=https' --tlsv1.2 -sSf -L https://install.determinate.systems/nix | sh -s -- install # Or use the official Nix installer and enable flakes: sh <(curl -L https://nixos.org/nix/install) # Then add to ~/.config/nix/nix.conf: # experimental-features = nix-command flakes
-
(Optional but recommended) Install direnv:
# macOS brew install direnv # Or via Nix nix profile install nixpkgs#direnv
Then add to your shell config (
~/.bashrcor~/.zshrc):eval "$(direnv hook bash)" # for bash eval "$(direnv hook zsh)" # for zsh
The repository includes a .envrc file that automatically loads the Nix environment:
cd /path/to/helmor/calypso
# Allow direnv (first time only)
direnv allow
# Environment automatically loads when you cd into the directory!
# You should see: "🚀 Helmor development environment loaded!"Now you can run commands directly:
bun install
bun run devWithout direnv, manually enter the Nix shell:
cd /path/to/helmor/calypso
# Enter the development shell
nix develop
# Now run your commands
bun install
bun run devRun commands without entering the shell:
nix develop --command bun run dev
nix develop --command bun run testThe Nix flake provides:
- Bun - JavaScript/TypeScript runtime and package manager
- Rust toolchain - Stable Rust with
rust-analyzer,clippy,rust-src - Node.js 20 - For tools that require Node
- Git - Version control
- cargo-watch - Watch Rust files for changes
- Apple SDK frameworks (Security, CoreServices, AppKit, WebKit, Cocoa, etc.)
libiconv
- WebKitGTK 4.1
- GTK3, Cairo, GDK-Pixbuf, GLib
- DBus, OpenSSL 3, libsoup 3, librsvg
- Additional build tools (ATK, Pango)
RUST_BACKTRACE=1- Verbose Rust error tracesRUST_LOG=info- Rust logging level- Properly configured
PKG_CONFIG_PATHandLD_LIBRARY_PATH(Linux)
Once in the environment (via nix develop or direnv):
# Setup
bun install # Install dependencies
# Development
bun run dev # Start Tauri + Vite dev server
bun run dev:analyze # Dev mode with performance HUD
# Building
bun run build # Build frontend bundle
bun run typecheck # TypeScript type checking
# Linting
bun run lint # Run biome + clippy
bun run lint:fix # Auto-fix lint issues
# Testing
bun run test # Run all test suites
bun run test:frontend # Vitest (React components)
bun run test:sidecar # Sidecar TypeScript tests
bun run test:rust # Rust integration tests
bun run test:rust:update-snapshots # Update insta snapshotsEnsure flakes are enabled in your Nix config (~/.config/nix/nix.conf):
experimental-features = nix-command flakes
- Check that direnv is installed:
which direnv - Check that the hook is in your shell config:
echo $DIRENV_* - Allow the directory:
direnv allow - Reload your shell:
exec $SHELL
- Exit and re-enter the shell:
exitthennix develop - Update flake inputs:
nix flake update - Rebuild:
nix develop --rebuild
Ensure Xcode Command Line Tools are installed:
xcode-select --installThe flake includes WebKitGTK 4.1. If you still see errors:
# Update PKG_CONFIG_PATH manually
export PKG_CONFIG_PATH="$(nix develop --print-build-environment | grep PKG_CONFIG_PATH | cut -d= -f2-)"Update Nix flake inputs to latest versions:
nix flake updateThe flake uses NixOS 24.11 (stable) as the primary channel to ensure reliable Darwin SDK frameworks. A separate nixpkgs-unstable input is available for bleeding-edge packages when needed.
This dual-input approach gives you:
- Stable, tested packages from
pkgs.*(24.11 - last working Darwin SDK) - Latest packages from
pkgs-unstable.*when you need them
To use a package from unstable, modify flake.nix:
commonBuildInputs = with pkgs; [
bun # from nixos-24.11 (stable)
pkgs-unstable.someNewPackage # from nixpkgs-unstable (bleeding edge)
# ...
];Why 24.11 instead of 25.11 or unstable?
As of April 2026, both 25.11 and nixpkgs-unstable have breaking changes in Darwin SDK (apple_sdk_11_0 removal) that cause build failures on macOS. The 24.11 release is the last known version with working Darwin SDK frameworks. This approach gives you stability by default with the option to pull newer packages when needed.
- Security, CoreServices, CoreFoundation
- Foundation, AppKit, WebKit, Cocoa
- libiconv
Stable Rust from rust-overlay with extensions:
rust-src(for IDE tooling)rust-analyzer(LSP)clippy(linter)
- Reproducible builds - Same environment on every machine
- No system pollution - Dependencies isolated in Nix store
- Version pinning - Flake lock ensures consistent versions
- Cross-platform - Works on macOS, Linux, NixOS
- Easy onboarding - New developers just run
nix develop - Automatic cleanup - Old dependencies garbage collected
While a Dockerfile could provide similar isolation, Nix is preferred for Helmor because:
- Lower overhead (no container runtime)
- Native macOS support (important for Tauri)
- Better IDE integration
- Faster iteration (no rebuilds on
package.jsonchanges)
- Nix Flakes Guide
- direnv Documentation
- Zero to Nix - Beginner-friendly tutorial