Enterprise-grade development environment with AI-powered tooling
Modern Nix flakes-based dotfiles providing reproducible cross-platform development environments for macOS and NixOS. Built following 2024 best practices with comprehensive testing, AI integration, and zero-configuration deployment.
- RFC-Compliant Architecture: Follows RFC 166 formatting and RFC 145 documentation standards
- Cross-Platform Excellence: Native support for
aarch64-darwin,x86_64-linux, andaarch64-linux - AI-First Development: Deep Claude Code integration with 20+ specialized commands and MCP servers
- Assertions as Derivations: every check is a Nix build, so
nix flake checkis the whole test runner - Zero-Config Deployment: Reproducible environments with flake-based dependency management
- Production Monitoring: Real-time build performance and resource usage tracking
System Requirements:
- Nix 2.19+ with flakes enabled (Determinate Nix Installer recommended)
- macOS 12+ (Monterey) or NixOS 23.05+
- Git 2.30+ with SSH or HTTPS access
- 8GB+ RAM and 10GB+ disk space for full installation
Development Requirements:
- pre-commit 3.0+ for quality enforcement
- Claude Code CLI for AI-powered development assistance
- Docker (optional, for containerized testing)
# 1. Clone repository with SSH (recommended) or HTTPS
git clone git@github.com:baleen37/dotfiles.git # SSH
# git clone https://github.com/baleen37/dotfiles.git # HTTPS alternative
cd dotfiles
# 2. Initialize development environment
make install-hooks # Install pre-commit hooks for quality enforcement
# 3. Evaluate every supported system
nix flake check --no-build --all-systems --show-trace
# 4. Build a Darwin or NixOS configuration without activating it
nix build '.#darwinConfigurations.macbook-pro.system'
nix build '.#nixosConfigurations.vm-aarch64-utm.config.system.build.toplevel'
# 5. Activate a standalone Home Manager profile
make switch-home HM_USER=jito.helloIf you're using Determinate Nix Installer (recommended), you need to configure trusted users to avoid cache warnings:
# Add your user as a trusted user
sudo vi /etc/nix/nix.custom.conf
# Add this line (replace 'baleen' with your username):
trusted-users = root @admin baleen
# Restart terminal to apply changesLocal builds are accelerated by binary substituters, especially https://baleen-nix.cachix.org, https://nix-community.cachix.org, and https://cache.nixos.org/. When CI pushes a built closure to Cachix on main or tags, local nix build and make switch can download matching store paths instead of rebuilding them.
GitHub actions/cache is CI-only. It can speed repeated workflow runs on GitHub-hosted runners, but it does not make local macOS builds faster. Do not store credentials in cached paths.
Done! You now have 50+ development tools and complete AI assistance ready.
Get AI development assistance with 20+ specialized commands:
# Install Claude Code (if not already installed)
# Visit: https://claude.ai/code
# Quick setup (takes ~30 seconds)
claude /help # Should show specialized commands like /analyze, /spawn, /task
# Test advanced features
claude /analyze "current project structure"
claude /spawn "implement user authentication system"📚 Learn More: Quick Start Guide | Complete Integration Guide
- 50+ tools: git, vim, docker, nodejs, python, and more
- GUI apps: 34+ macOS applications via Homebrew
- Global commands:
blfor Baleen utilities and safe cleanup - Auto-updates: Keeps everything current automatically
- Testing: Built-in quality assurance
# Evaluate the full platform matrix
nix flake check --no-build --all-systems --show-trace
# Build configuration closures without activation
nix build '.#darwinConfigurations.macbook-pro.system'
nix build '.#nixosConfigurations.vm-aarch64-utm.config.system.build.toplevel'
# Activate a standalone Home Manager profile
make switch-home HM_USER=jito.hello
# Format source files
make format# Darwin aarch64-darwin
nix build '.#darwinConfigurations.macbook-pro.system'
# NixOS aarch64-linux
nix build '.#nixosConfigurations.vm-aarch64-utm.config.system.build.toplevel'
# Disposable NixOS VM smoke test (Linux + KVM only)
nix run .#test-vm
ssh testuser@localhost -p 2222 # password: testSupported platforms: Darwin aarch64-darwin; NixOS x86_64-linux and
aarch64-linux.
| Make target | Darwin (aarch64-darwin) |
NixOS (x86_64-linux) |
NixOS (aarch64-linux) |
|---|---|---|---|
| Core Operations | |||
| switch | ✅ | ✅ | ✅ |
| switch-home | ✅ | ✅ | ✅ |
| format | ✅ | ✅ | ✅ |
| Testing | |||
| test | ✅ | ✅ | ✅ |
| test-build | ✅ | ✅ | ✅ |
| test-containers | ❌¹ | ✅² | ✅² |
| Secrets | |||
| secrets/backup | ✅ | ✅ | ✅ |
| secrets/restore | ✅ | ✅ | ✅ |
¹ NixOS VM tests need a Linux builder; Determinate Nix disables the macOS
linux-builder, so run them in CI or a Linux VM.
² Requires /dev/kvm. Where it is missing, make test degrades to
nix flake check --no-build, which evaluates checks without running assertions.
make test-build runs the unit and integration assertions on any platform, but it
deliberately excludes the NixOS VM tests — those need make test-containers or CI.
This system follows evantravers' minimalist approach with user-centric configuration files.
users/shared/
├── home-manager.nix # Main user configuration, imports everything below
├── darwin/ # macOS-specific settings
├── programs/ # One file (or directory) per tool
│ ├── git.nix
│ ├── vim.nix
│ ├── zsh/
│ └── tmux.nix
├── packages/ # Categorised package lists
└── .config/claude/ # Claude Code configurationFlake evaluation is pure. HM_USER is only a standalone Home Manager profile
selector, defaulting to the current shell user. It does not declare a host's
system user:
make switch-home HM_USER=jito.helloFor detailed configuration options, see Configuration Guide.
dotfiles/
├── flake.nix # Inputs; outputs are assembled by flake-modules/
├── flake-modules/ # hosts, systems, home, checks, packages, formatter
├── lib/
│ ├── mksystem.nix # System factory
│ ├── cache-config.nix
│ ├── overlays.nix
│ └── user-info.nix # Single source of truth for git identity
├── machines/ # Hardware and system settings
│ ├── darwin/common.nix
│ └── nixos/
├── users/shared/ # User configuration (see above)
└── tests/ # unit/, integration/, containers/, lib/
# Evaluate every supported system
nix flake check --no-build --all-systems --show-trace
# Build representative configuration closures without activation
nix build '.#darwinConfigurations.macbook-pro.system'
nix build '.#nixosConfigurations.vm-aarch64-utm.config.system.build.toplevel'
# Activate a standalone Home Manager profile
make switch-home HM_USER=jito.hellomake switch activates the current host's system configuration. It is an
explicit operating procedure, not part of the default development or PR
workflow; run it only on the intended host after the relevant build and
verification steps.
The system follows evantravers' minimalist user-centric architecture:
- System Factory (
lib/mksystem.nix) provides a unified interface for building systems - User Configuration (
users/shared/) contains all user-specific settings in flat files - Machine Definitions (
machines/) define hardware-specific configurations - Test Framework (
tests/) provides comprehensive TDD-based validation
Host metadata is internal to the flake: flake-modules/hosts.nix declares typed
dotfiles.hosts entries with their platform, class, explicit system user, and
machine modules. flake-modules/systems.nix turns them into Darwin and NixOS
outputs. The host user field declares the system user; it is separate from
the standalone HM_USER profile selector.
Add packages to the matching category in users/shared/packages/ (e.g. dev.nix), or configure a tool in users/shared/programs/.
users/shared/- User-centric configuration files (one file per tool)lib/mksystem.nix- System factory following evantravers patternmachines/- Machine-specific system configurationstests/- TDD-based test framework with helpers
The project uses declarative Nix solutions for development tooling:
- Formatting:
flake-modules/formatter.nixwires up treefmt (invoked viamake format) - Testing: Native
nix flake checkfor validation - Building:
make switchwraps darwin-rebuild / nixos-rebuild / home-manager
Every check is a Nix derivation that builds if an assertion holds. See tests/README.md for the contract and helper inventory.
make test # Evaluate all checks
make test-build # Build every unit + integration assertion
make test-containers # NixOS VM tests (Linux + /dev/kvm)Container Test Coverage:
- Basic system functionality validation
- User configuration testing
- Services verification (SSH, Docker)
- Package installation validation
This project includes NixOS VM management commands for development and testing environments.
For NixOS VM workflows, build with:
nix build '.#nixosConfigurations.vm-aarch64-utm.config.system.build.toplevel'See machines/nixos/ for available VM configurations.
The VM management system supports:
- SSH-based deployment and management
- Automated NixOS installation
- Configuration synchronization
- Secrets management
# Required for VM commands
export NIXADDR=192.168.64.2 # VM IP address
export NIXPORT=22 # SSH port (default: 22)
export NIXUSER=root # SSH user (default: root)- ✅ Darwin
aarch64-darwin - ✅ NixOS
x86_64-linux - ✅ NixOS
aarch64-linux
make update # Update all packages
nix flake update # Update flake inputsConfiguration changes are automatically backed up with conflict resolution.
# Baleen toolkit commands are installed by Home Manager
bl --help # Usage information
bl list # Show available commands
bl gc stats # Show cache, disk, and stale worktree sizes
bl gc --dry-run # Show cleanup plan without deleting
bl gc # Confirm and clean regenerable development data- Build optimization: Parallel builds with optimal job configuration
- Platform-specific builds: Target current platform for faster iteration
- Intelligent caching: Build artifact caching and reuse
- Resource monitoring: Build time and memory usage tracking
Built-in AI development assistance with 20+ specialized commands and MCP server integration. Features automated workflow improvements and smart commit message generation.
After applying the appropriate standalone Home Manager profile, restart Claude
Code and run /help. System activation, when required, follows the explicit
operating procedure above rather than the default development workflow.
Install Model Context Protocol servers for enhanced Claude Code functionality:
# Install MCP servers using Claude CLI
claude mcp add @modelcontextprotocol/server-filesystem
# List installed servers
claude mcp listAvailable MCP Servers:
- Filesystem - File system access and manipulation
- Additional servers can be installed via
claude mcp addas needed
/build- Build and test with validation/commit- Generate semantic commits/commit-push-pr- Commit changes, push, and create pull request/update-claude- Update Claude configuration
- Smart config management with automatic backups
- Context-aware assistance for Nix and Git
- MCP server integration for enhanced file system access
- Dotfiles-specific guidance and best practices
- File references using
@filesystem:path://filename
- CLAUDE.md - Claude Code project instructions
- CONTRIBUTING.md - Development guidelines
- docs/ - Detailed guides and references
Build failures:
nix store gc # Clear cache
nix build '.#darwinConfigurations.<your-machine>.system' # RetryPermission issues:
make switchSee docs/TROUBLESHOOTING.md for more solutions.
- Run
nix flake show --all-systemsto see all configurations - Add packages in
users/shared/packages/<category>.nixor a tool module - Check CONTRIBUTING.md for development
Nix flakes + evantravers pattern for declarative, reproducible environments.