This repository provides a template for managing homebrew apps and terminal programs for macOS using Nix, flakes, and nix-darwin.
The goal is a reproducible, shareable macOS setup that can be installed and updated reliably across multiple machines.
The template includes:
- A full nix-darwin system configuration
- Package definitions
- macOS defaults
- Helper scripts for installation and updates
You need:
- macOS (Intel or Apple Silicon)
- Xcode Command Line Tools
Install the Xcode Command Line Tools if missing:
xcode-select --installThis project is not used directly from the repo. Its contents must be copied into the correct directories inside your home folder.
Copy the directories from this template as follows:
./dot_config/nix → ~/.config/nix/
./dot_local/bin → ~/.local/bin/
Example:
mkdir -p ~/.config/nix
mkdir -p ~/.local/bin
cp -r dot_config/nix/* ~/.config/nix/
cp -r dot_local/bin/* ~/.local/bin/If ~/.local/bin is not already in your PATH, add it manually.
For zsh:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcCheck:
which dot-init.shIf it prints a path → you're good.
Run the installation script:
dot-init.shThis script:
- Installs Nix (multi-user mode)
- Installs nix-darwin using flakes
- Applies your macOS configuration
- Loads all system defaults and settings from this template
After successful installation, you can manually trigger a rebuild anytime:
darwin-rebuild switch --flake ~/.config/nixWhenever you update any Nix configuration files inside:
~/.config/nix/apply the changes with:
dot-update.shflake.nix: Main flake definition for nix-darwin.macos.nix: All macOS defaults, UI tweaks, system settings, etc.packages.nix: Global packages installed system-wide.utils.nix: Utility helpers used throughout the configuration.nix.conf: User-level Nix configuration.dot-init.sh: Bootstraps Nix + nix-darwin on a fresh machine.dot-update.sh: Applies configuration changes to the running system.