Declarative macOS development environment using Nix Flakes, nix-darwin, and home-manager.
- Modular architecture: 45+ tool configurations, each with its own
default.nix - Multi-host support: Separate personal and work configurations sharing common modules
- AI-powered development: Unified configuration for claude-code, opencode, and zed with Sisyphus multi-agent orchestration
- Cross-tool integrations: fzf + bat/eza, git + delta, and more
- Reproducible builds: Everything managed via Nix flakes for complete reproducibility
-
Install Determinate Nix
-
Clone the repo:
git clone https://github.com/mattietea/config ~/.config/nix -
Initial build:
sudo -i nix run nix-darwin -- switch --flake ~/.config/nix
This project uses devenv for development environment management. Enter the devenv shell to access all tools:
devenv shellAvailable scripts (run from within devenv shell or via devenv shell -- <script>):
# Apply changes to nix-darwin
switch
# Format all files (uses treefmt with nixfmt, prettier, yamlfmt)
format
# Lint Nix files (uses statix)
lint
# Update flake inputs
update
# Clean up old Nix generations
clean# Apply changes
sudo darwin-rebuild switch --flake .
# Format code
nix fmt
# Update packages
nix flake update
# Clean up old generations
nix-collect-garbagesudo determinate-nixd upgradeThis project uses devenv to manage the development environment. The devenv.nix file configures:
- Language Server: nixd for Nix language support
- Formatting: treefmt with nixfmt (RFC 0076), prettier, and yamlfmt
- Linting: statix for Nix files, shellcheck for shell scripts
- Git Hooks: Automatic formatting and linting on commit
All formatting uses RFC 0076 style via nixfmt:
- VS Code format-on-save uses nixfmt
treefmtcommand uses nixfmt for Nix files- Git hooks use treefmt (which uses nixfmt)
VS Code is configured to use tools from the devenv environment:
- nix-ide extension uses nixd from devenv
- Formatting uses nixfmt from devenv
- All tools are automatically available when working in this project
The configuration uses a modular architecture following standard nix-darwin and home-manager patterns:
Entry Point (flake.nix):
- Defines flake inputs (nixpkgs, nix-darwin, home-manager)
- Creates host configurations by hostname (e.g.,
Matts-Work-MacBook-Pro) - Passes
inputsdirectly to host configurations
Host Configurations (hosts/work/, hosts/personal/):
- Each host directly calls
darwin.lib.darwinSystem(standard pattern) - Defines
settings: username, email, environment variables - Imports darwin modules (system-level configuration)
- Lists all home-manager modules in
sharedModules(user-level configuration) - Configures home-manager integration
Darwin Modules (modules/darwin/):
- System-level macOS configuration
- macOS system preferences (Dock, Finder, trackpad, keyboard)
- Applied globally to all hosts via module import
- Each module is a folder with a
default.nixfile - Example:
modules/darwin/system/default.nix
Home Manager Modules (modules/home-manager/):
- User-level configuration (dotfiles, user packages, programs)
- Organized into
applications/(GUI apps) andpackages/(CLI tools) - Each module is a folder with a
default.nixfile - Uses home-manager module system
- Imported via
sharedModulesin host configurations - To add a new tool: create a new folder with
default.nixin the appropriate subdirectory (applications/orpackages/) and add it to thesharedModuleslist in the appropriate host file - Folder structure allows for additional files alongside modules (e.g., config files, scripts)
.
├── flake.nix # Flake inputs and outputs
├── devenv.nix # Development environment & scripts
├── .claude/auto-memory/ # Auto-memory plugin cache (gitignored)
├── .vscode/ # VS Code workspace settings
│ ├── settings.json # Editor configuration (formatting, linting)
│ └── extensions.json # Recommended extensions
├── hosts/
│ ├── personal/default.nix # Personal MacBook Air config
│ └── work/default.nix # Work MacBook Pro config
└── modules/
├── darwin/system/ # macOS system defaults
└── home-manager/
├── ai/ # Shared AI config (claude-code, opencode, zed)
│ ├── default.nix # Exports: mcpServers, rules, agents
│ ├── mcp.nix # MCP server definitions
│ ├── rules.nix # Shared CLAUDE.md/AGENTS.md content
│ └── agents.nix # Agent definitions
├── applications/ # GUI apps (brave, zed, discord, etc.)
│ └── */default.nix
└── packages/ # CLI tools (git, fzf, zsh, etc.)
└── */default.nix
Key configuration flow:
hosts/{personal,work}/default.niximports modules viasharedModules- Each module configures a tool using home-manager or
home.packages - AI tools (claude-code, opencode, zed) share config from
modules/home-manager/ai/ - Cross-tool integrations reference packages via
${pkgs.tool}/bin/tool