Skip to content

Moving to a new Mac

This is the payoff for describing your machine as text: a new Mac (or a wiped one) is a restore, not a weekend of clicking through System Settings. Your config is in git; you point a fresh machine at it and it converges to the exact same system.

A few things live outside Nix on purpose — secrets, keychain trust, hardware keys. Those are the manual bits, and they’re a short, honest checklist.

The happy path (you already have a nebelhaus config)

Section titled “The happy path (you already have a nebelhaus config)”

If your ~/.config/nix is pushed to git somewhere, restoring is two moves:

  1. Point the installer at your config. The same one-liner that scaffolds a fresh setup also restores an existing one — it installs the Xcode CLT and Determinate Nix if they’re missing, then clones your repo into place and skips the interview entirely:

    Terminal window
    curl -fsSL https://nebelhaus.com/init.sh | bash -s -- --from <your-config-remote>
  2. Build, then switch:

    Terminal window
    cd ~/.config/nix
    nix build .#darwinConfigurations.$(scutil --get LocalHostName).system \
    && sudo ./result/sw/bin/darwin-rebuild switch --flake .

(Prefer doing it by hand? xcode-select --install, install Determinate Nix, and git clone your config to ~/.config/nix — that’s all --from does.)

That first build downloads the world and takes a while; after it, haus is on your PATH and the machine is yours again.

Once that switch finishes, the rebuild has already restored:

  • Every declared GUI app — anything with a cask in your roster or in homebrew.casks reinstalls itself.
  • Your whole shell — Ghostty, zellij, zsh, starship, yazi, helix, and the CLI toolbelt, themed and configured.
  • All your CLI tools from home.packages.
  • The macOS defaults the rice manages (Dock, Finder, trackpad, key repeat, the Caps-Lock remap, ⌘Space).
  • The background agents — tiling, the bar, and the launcher, launched via launchd so they survive the next cold boot.

By design, a handful of things never enter your Nix config. Walk this list once on a fresh machine:

  1. Secrets. Copy your ~/.secrets/* files over securely (AirDrop, a password manager, an encrypted drive). They’re git-ignored on purpose, so they don’t ride along in the clone.

  2. Commit signing keys. If you sign commits, import your GPG/SSH key material and set up gpg-agent + pinentry-mac (or your YubiKey). The key id is in your config; the key material is not.

  3. Pounce’s Accessibility grant. macOS ties this to the machine, so re-grant it once:

    Terminal window
    pounce --request-accessibility

    If you use nebelhaus.pounce.signingIdentity, make sure that signing certificate is in the new machine’s keychain (import it, or create a fresh Apple Development cert and update the SHA-1 in your host file) so the grant survives future rebuilds. See Pounce config.

  4. Apps outside the config. Anything you installed by hand won’t reappear — reinstall those, and consider moving the ones you care about into your config (a cask or masApps) so next time they do.

  5. App logins & licences. Nix restores the app; it can’t restore your session. Sign back into the handful of apps that need it.

Not restoring — adopting nebelhaus on a Mac you’ve already set up by hand? The install flow is built for exactly that, and it’s careful:

  • Your Homebrew casks are kept. The preflight audit lists what it sees; nothing is removed.
  • Dotfiles are backed up, not clobbered — anything the rice manages gets a .backup copy first.
  • Your current macOS settings can be captured into your new host file, so the switch doesn’t fight preferences you already like.
  • The interview collects your name, email, accent, editor, and which rooms you want — then scaffolds ~/.config/nix and commits it. Nothing activates until you run the build command it prints.

Then it’s the normal first run, and from there everything on Making it yours applies.