Manage and rebuild nix-darwin macOS system configurations with Nix Flakes and Home Manager support
Assists with managing a declarative macOS system configuration built with Nix Flakes and nix-darwin. Handles system rebuilds, package updates, profile switching, and configuration changes.
This skill helps you work with a nix-darwin + Home Manager configuration that declaratively manages macOS system settings, applications, and dotfiles. It supports dual profiles (personal/work), handles system rebuilds, manages flake updates, and guides configuration modifications.
Before making changes, familiarize yourself with the architecture:
- `common.nix` — Shared development tools (neovim, git, tmux)
- `personal.nix` — Personal applications (Discord, Blender, Obsidian)
- `work.nix` — Work-specific tools (1Password, EAS CLI)
- `homebrew.nix` — Homebrew packages and casks
- `dock.nix` — macOS dock configuration
- `karabiner.nix` — Keyboard remapping
- `git.nix` — Git configuration with work/personal email switching
- `ghostty.nix` — Terminal emulator settings
- `zsh.nix` — Shell configuration
After making configuration changes, rebuild the system:
**For personal profile:**
```bash
sudo /Users/john/.config/nix/rebuild-and-switch.sh
darwin-rebuild-switch
```
**For work profile:**
```bash
sudo /Users/john/.config/nix/rebuild-and-switch-work.sh
darwin-rebuild-switch-work
```
To update all flake inputs (package versions):
```bash
nix flake update
flake-update
```
This updates `flake.lock` with the latest package versions from nixpkgs and other inputs.
Remove old system generations (older than 7 days):
```bash
sudo nix-collect-garbage --delete-older-than 7d
darwin-cleanup
```
When modifying the system:
1. **Identify the correct file** based on what you want to change:
- System-wide settings → `configuration.nix`
- User dotfiles/programs → `home.nix` or `home-manager/*.nix`
- Applications → `apps/common.nix`, `apps/personal.nix`, or `apps/work.nix`
- macOS-specific settings → `macos/*.nix`
2. **Edit the file** using your preferred editor
3. **Test the changes** by rebuilding:
```bash
darwin-rebuild-switch # or -work variant
```
4. **Verify** the changes took effect
5. **If dotfiles changed**, remember that Home Manager creates symlinks from `/dotfiles/`, so edits to those files require a rebuild to activate
The configuration includes these Git aliases (defined in `configuration.nix`):
**Development environment includes:**
**Configuration management:**
**If rebuild fails:**
**If dotfile changes don't appear:**
**Example 1: Add a new application to the personal profile**
User: "Add Visual Studio Code to my personal applications"
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/nix-darwin-system-configuration-manager/raw