Prerequisites
Before you begin, ensure you have:- macOS 10.15 (Catalina) or later
- Administrator access
- At least 10GB of free disk space
- Xcode Command Line Tools installed
The macOS configuration uses Homebrew for apps that aren’t available in Nixpkgs. The setup is fully declarative using nix-homebrew.
Installation
Install Lix package manager
Install Lix, a modern Nix implementation:After installation, open a new terminal or source your shell profile:
Enter development shell
Use a Nix development shell to access required tools like git:This provides a temporary environment with all necessary dependencies.
Choose your host
Check the available macOS configurations:The example configuration looks like:You can either:
- Use
tatsumakias your host name - Create a new configuration for your Mac
Create your host configuration (optional)
If you want to create a custom configuration:Add your host to
systems/default.nix:Provision the system
Run the provision command to apply the configuration:Or use the full command:
The first run will take significant time as it downloads and builds all packages, including Homebrew casks.
Homebrew integration
The configuration usesnix-homebrew to make Homebrew apps fully reproducible. The setup includes:
Configured casks
The default configuration installs these applications via Homebrew:Homebrew formulae
All Homebrew packages are pinned to specific versions through nix-homebrew for reproducibility. This means
brew update won’t work as expected - instead, update the flake.Post-installation
Apply future changes
After modifying your configuration, apply changes using:Verify the installation
Check that the system is using your configuration:Using justfile commands
The repository includes macOS-specific just commands:Configuration options
System profiles
Available profiles you can enable:graphical- GUI applications and desktop environmentlaptop- Laptop-specific settings (battery, trackpad)workstation- Development tools and productivity apps
Customizing Homebrew packages
Editmodules/darwin/brew/default.nix to add or remove applications:
Hardware configuration
For macOS, hardware detection is automatic, but you can configure:Troubleshooting
”experimental-features” error
If you get an error about experimental features:Homebrew installation fails
If Homebrew packages fail to install:Permission denied errors
Ensure you’re running darwin-rebuild withsudo:
Rolling back changes
If something breaks, roll back to a previous generation:Mac App Store apps
Some apps require manual installation from the App Store first:Architecture differences
Apple Silicon (M1/M2/M3)
For Apple Silicon Macs, set:Intel Macs
For Intel Macs, set:Next steps
Configuration guide
Learn how to customize your setup
Modules reference
Explore available modules