nixmac

Introduction

What nixmac is, how it works, and how it relates to nix-darwin

What is nixmac?

nixmac is a native macOS desktop app that helps you manage your nix-darwin configuration using an AI coding agent. Instead of manually editing .nix files, you describe what you want in natural language and nixmac makes the changes for you.

nixmac is built on standard nix-darwin. Your configuration is a regular Nix flake that works with darwin-rebuild — nixmac adds an AI interface on top.

How it relates to nix-darwin

If you already know nix-darwin, nixmac is a GUI + AI layer over it:

You want to...Without nixmacWith nixmac
Install a packageEdit environment.systemPackages in your .nix fileTell nixmac "install ripgrep"
Set Dock to autohideAdd system.defaults.dock.autohide = true;Tell nixmac "make the dock autohide"
Fix a build errorRead the error, find the issue, edit the filePaste the error — nixmac diagnoses and fixes it
Rebuilddarwin-rebuild switch --flake .Click Build & Test in the app

In every case, the result is the same: a standard nix-darwin configuration that you own and can edit directly.

Key concepts

The AI agent

nixmac's core is an AI coding agent that understands nix-darwin. When you give it a prompt — either through the app's chat interface or via the CLI — it:

  1. Reads your current configuration files
  2. Determines which files and attributes to change
  3. Makes targeted edits using structured Nix editing tools
  4. Runs build checks while it works so obvious Nix errors can be fixed before handoff
  5. Shows you what changed so you can build, activate, commit, or discard

The agent can:

  • Install or remove packages via environment.systemPackages
  • Configure macOS system preferences via system.defaults.*
  • Manage dotfiles and programs through home-manager
  • Add fonts, scripts, or custom packages
  • Diagnose and fix build errors
  • Explain how your nix-darwin configuration works

Your configuration directory

Your nix-darwin configuration lives at ~/.darwin/ by default (configurable in the app's settings). This directory contains your flake.nix and module files — standard Nix that nix-darwin and darwin-rebuild understand natively.

Build & Test, Then Commit

After the AI edits your config files, nixmac follows an activation-first workflow:

  1. Build & Test — builds the nix-darwin configuration and activates it with macOS administrator approval. This is the system-changing step.
  2. Active, uncommitted changes — after activation succeeds, nixmac shows the changed files and a suggested commit message. The changes are live on your Mac but not yet recorded in git.
  3. Commit or Undo — commit saves the active changes to git. Undo restores the last committed config and rebuilds so the running system matches it again.

nixmac tracks your ~/.darwin/ configuration in a git repository — every commit is a recoverable snapshot.

Transparency

nixmac does not define its own configuration language or wrap nix-darwin in a proprietary layer. Your flake.nix uses nix-darwin.lib.darwinSystem directly. You can:

  • Open ~/.darwin/ in any editor and make changes manually
  • Rebuild without nixmac: darwin-rebuild switch --flake ~/.darwin (or sudo -i nix run nix-darwin/master#darwin-rebuild -- switch --flake ~/.darwin on Determinate Nix installs where darwin-rebuild is not globally available)
  • Move your config to another machine and use it with plain nix-darwin
  • Inspect every change nixmac makes in the git history

What's next?

On this page