This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
nix develop # Enter default development shell with all tools
nix develop .#go # Go development environment
nix develop .#node # Node.js development environment
nix develop .#terraform # Terraform environment
nix develop .#ansible # Ansible environment
nix develop .#nix # Nix development tools
nix develop .#ui # UI development (Node + testing tools)
nix develop .#zig # Zig development environmentmake check # Run nix flake check (validates flake structure)
make build # Build all package sets
make build-scripts # Build individual scripts only
make test # Run all tests
make test-shells # Test all development shell environments
make ci-local # Run full CI checks locally (check + fmt + lint + build + test-shells)make fmt # Format all code (Go, JS/TS, Python, Shell, Nix)
make lint # Lint all code with various tools
make quick # Quick cycle: fmt + lint + check
scripts/fmt # Direct format script execution
scripts/lint # Direct lint script executionmake install-hooks # Install pre-commit hooks
make run-hooks # Run pre-commit hooks on all files
pre-commit run --all-files # Manual pre-commit executionmake update # Update flake inputs
make upgrade # Run dependency upgrade script
make tidy # Clean up and organize code
make clean # Clean build artifacts (removes result*)All scripts are available as both Nix packages and shell scripts in ./scripts/:
cex- Curl and Execute utility for running remote scriptsfmt- Multi-language code formatter (Go, JS/TS, Python, Shell, Nix)lint- Multi-language linter with extensive tool supporttidy- Code organization and cleanupupgrade- Dependency and tool upgradingfuzz- Enhanced parallel fuzzing with error handling and configurable executionfuzz-go- Go-specific fuzzinglicense- Enhanced license management with fallback header creationtag- Version tagging utility
This is a multi-environment development flake that provides:
- Stable + Unstable Mix: Uses NixOS 25.05 stable as base with select unstable packages (Go toolchain, Zig)
- Multiple Dev Shells: Specialized environments for different technology stacks (Go, Node, Terraform, etc.)
- Unified Tooling: Common development scripts work across all environments
- Binary Cache: Uses Cachix (oss-devnw.cachix.org) for fast builds
- Main entry point defining all development environments
- Imports individual Nix modules for complex packages
- Configures binary cache for faster builds
- Exports both individual scripts and package collections
- Imports and combines all individual script definitions
- Each script is defined in its own
.nixfile (fmt.nix, lint.nix, etc.) - Scripts are built as Nix derivations with proper dependencies
Located in ./scripts/ directory:
- fmt: Multi-language formatter supporting Go (goimports, gofmt), JS/TS (prettier), Python (black), Shell (shfmt), Nix (nixfmt)
- lint: Comprehensive linting with golangci-lint, eslint, flake8, shellcheck, nixfmt, statix, sqlfluff
- cex: Downloads and executes scripts from remote repositories
- tidy/upgrade: Maintenance utilities for dependency management
- Shared configurations stored in
./shared/directory (referenced in CRUSH.md) - Scripts use
CONFIG_DIRenvironment variable with fallback to./shared - Tools support both local configs and shared defaults
Each script is available as: nix build .#scriptname (e.g., .#fmt, .#lint, .#cex)
commonPackages: Core development toolsgoPackages: Go development stackterraformPackages: Infrastructure toolsansiblePackages: Configuration managementnixPackages: Nix development toolsuiPackages: Frontend development toolszigPackages: Zig language tools
- Pre-commit hooks automatically installed in dev shells
- GitHub Actions workflows for comprehensive testing
- Cachix integration for binary caching
- Makefile provides local CI simulation with
make ci-local
- Enter Environment:
nix developor specific shell (.#go,.#node, etc.) - Install Hooks:
make install-hooks(first time only) - Development Cycle:
make quick(format, lint, check) - Full Validation:
make ci-localbefore committing - Commit: Pre-commit hooks run automatically
The fuzz script has been significantly enhanced with:
- Parallel execution across multiple CPU cores
- Error handling with file output and stderr tee
- Continue-on-failure option for comprehensive testing
- Configurable timing and job control
- Progress tracking with real-time status updates
See FUZZ.md for comprehensive documentation.
The license script now handles missing LICENSE files gracefully:
- Automatic fallback to create default headers when LICENSE_HEADER is missing
- Multi-location search for LICENSE and LICENSE_HEADER files
- Git repository detection for license file discovery
- Comprehensive error handling with detailed reporting
- Help system with usage examples
- This repository focuses on development environment tooling rather than application code
- The
test_dir/contains sample files for testing the development tools - All environments include the custom scripts as part of their PATH
- Binary cache significantly speeds up initial setup and CI/CD
- Scripts are designed to work with or without configuration files
- Enhanced scripts (
fuzz,license) provide production-ready capabilities with robust error handling
This flake fully supports the follows mechanism for dependency management. See FLAKE_USAGE.md for:
- How to use
followsto control nixpkgs versions from parent flakes - IMPORTANT: How to avoid making
unstablefollow stablenixpkgs(common mistake!) - Using the overlay for custom package sets
- Available development shells and packages
- Troubleshooting common issues
Quick Tip: When using this flake, either don't override the unstable input at all, or make it follow an actual unstable channel. The flake will warn you if it detects this misconfiguration.
Darwin SDK Deprecation Warning: On macOS, you may see a warning about darwin.apple_sdk_11_0.callPackage being deprecated. This is a nixpkgs internal warning from transitive dependencies and can be safely ignored. It will be resolved when upgrading to nixpkgs 25.11+.
Zig Versions: The flake automatically selects the best available Zig version from nixpkgs-unstable with fallback support:
- Prefers zig_0_15, falls back to zig_0_14, zig_0_13, or latest zig
- ZLS (Zig Language Server) and zig-zlint are optional components
- Works across different nixpkgs-unstable versions without version pinning errors