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 macOS (Intel + Apple Silicon) and NixOS (x86_64 + ARM64)
- 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
export USER=$(whoami) # Required for Nix commands (set automatically by direnv when entering the directory)
make install-hooks # Install pre-commit hooks for quality enforcement
# 3. Build and validate system
make test # Evaluate all checks
make test-build # Build every unit + integration assertion
# 4. Deploy system configuration
make switch # Apply configuration (requires sudo)If 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 project setup and utilities - Auto-updates: Keeps everything current automatically
- Testing: Built-in quality assurance
# Essential commands
export USER=$(whoami) # Required for Nix commands (set automatically by direnv when entering the directory)
nix build '.#darwinConfigurations.macbook-pro.system' --impure # Build (substitute your machine)
make switch # Apply changes
make test-build # Run the assertions
make format # Auto-format (wraps nix fmt)
# Quick operations
make test-build # Build every unit + integration assertion
make switch # Build and apply together
nix fmt # Direct Nix formatting (alternative)# Targeted builds
nix build '.#darwinConfigurations.macbook-pro.system' --impure # macOS
nix build '.#nixosConfigurations.vm-aarch64-utm.config.system.build.toplevel' --impure # NixOS
# Direct operations
make switch # Build and apply with sudo handling
make test # Evaluate all checks
make test-build # Build every unit + integration assertionSupported Platforms: macOS (Intel/ARM) and NixOS (x86_64/ARM64)
| Make target | macOS (Intel) | macOS (ARM) | NixOS (x86_64) | NixOS (ARM64) |
|---|---|---|---|---|
| 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 configurationRequired for Nix commands (set automatically by direnv when entering the directory):
# Required user variable for dynamic resolution
export USER=$(whoami)For 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/
# Build current system
nix build '.#darwinConfigurations.macbook-pro.system' --impure
# Run tests
make test-build
# Switch to new config
make switchThe 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
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' --impureSee 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)- ✅ macOS (Intel/ARM)
- ✅ Linux (x86_64/aarch64)
- ✅ Windows (via WSL2)
make update # Update all packages
nix flake update # Update flake inputsConfiguration changes are automatically backed up with conflict resolution.
# Install global command system
./scripts/install-setup-dev
# Available commands
bl setup-dev <project> # Initialize Nix development environment
bl list # Show available commands
bl --help # Usage information- 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.
make switch # Apply configuration
# Restart Claude Code
# Try: /helpInstall 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:
export USER=$(whoami) # Ensure USER is set
nix store gc # Clear cache
nix build '.#darwinConfigurations.<your-machine>.system' --impure # RetryPermission issues:
make switchSee docs/TROUBLESHOOTING.md for more solutions.
- Run
USER=$(whoami) nix flake show --impureto 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.