These are my dotfiles, managed by Nix, Nix-Darwin and Home Manager (via flakes).
dotfiles/
├── darwin/
| ├── profiles/
| | ├── alyssa.nix
| | └── ditto.nix
| └── configuration.nix
├── home-manager/
| ├── modules/
| | ├── ide/vscode # extensions & settings
| | └── common.nix
| └── profiles/
| ├── dev.nix # for devcontainers
| ├── home.nix
| └── work.nix
├── .devcontainer.json # Nix Package Manager
├── .gitignore # Nix artifacts
├── flake.lock
├── flake.nix # Home Manager config
├── justfile # Task Runner recipes
└── README.md
Nix is three things:
| Thing | What it is | You might use it to... |
|---|---|---|
| Nix (language) | A purely functional language for defining packages and configurations | Write .nix files |
| Nix (package manager) | A package manager that installs packages in isolation. Like homebrew. | nix profile install nixpkgs#ripgrep |
| NixOS (os) | A Linux distro configured entirely by Nix files | Run a fully reproducible system |
You don't need all three. This repo leverages Home Manager with flakes in a devcontainer (lightweight Debian with Nix Package Manager).
You need ONE of these:
| Option | What you need | Good for |
|---|---|---|
| Devcontainer | Docker + VSCode with Remote Containers | Exploring without installing Nix locally |
| GitHub Codespaces | A GitHub account | Exploring in the cloud |
| Local Nix | Nix installed | Already have Nix or want to install it |
nix-darwin manages macOS system configuration declaratively, including dock apps, system defaults (defaults write) and Homebrew packages.
Verified end-to-end on a clean tart VM (macOS Tahoe base image), 2026-07-01.
- Install Nix (official multi-user installer)
- Enable flakes — the official installer doesn't:
echo "experimental-features = nix-command flakes" | sudo tee -a /etc/nix/nix.confsudo launchctl kickstart -k system/org.nixos.nix-daemon
- Trust the third-party Homebrew taps (new
brewrequires this; also needed once on existing machines after a brew update):brew trust cirruslabs/cli getditto/build-infragetditto/build-infrais private —brew bundleclones it over https, so authenticate GitHub first (gh auth login+ credential helper) or pre-tap it from an SSH clone.
- Move aside the
/etcfiles nix-darwin wants to own (first activation only):for f in /etc/nix/nix.conf /etc/bashrc /etc/zshrc; do sudo mv "$f" "$f.before-nix-darwin"; done
- Bootstrap
nix-darwin(once) — build from this repo's pinned input rather thannix run nix-darwin(which resolves upstream HEAD via the GitHub API: version skew + rate-limited on shared IPs):nix build .#darwinConfigurations.ditto.systemsudo ./result/sw/bin/darwin-rebuild switch --flake .#ditto
- Rebuild after changes
just _rebuild ditto(the onlydarwinConfigurationisditto;alyssa@*names are Linux/devcontainerhomeConfigurations)
Gotchas seen on a fresh machine: the user the flake hardcodes (
alyssaevans) must exist before switching; the Homebrew prefix must be owned by that user (sudo chown -R alyssaevans /opt/homebrew) because nix-darwin now runsbrewas that user;tailscale-app's pkg installer fails inside VMs (system-extension approval) — expected in CI, fine on hardware.
! does not support nix-darwin
- Clone this repo
gh repo clone alycda/dotfiles
- Open in VSCode
ms-vscode-remote.remote-containers
- Click "Reopen in Container" when prompted
- or CMD+SHIFT+P > Dev Containers
- You now have
nixavailable:nix-envnix profile- nix-shell
- Bootstrap Home Manager (once)
nix run home-manager/master -- switch --flake .#alyssa@dev
- You now have
gh,hx,jjandjustavailable:- github cli
- What is jujutsu?
- rebuild with
justorjust _rebuild
nix develop github:alycda/dotfilesornix develop github:alycda/dotfiles#tools-c cheat -limmediately run a command AND EXIT
As long as you have docker or an ephemeral environment in the cloud, you can explore my setup without polluting your system.
| Directory | Tool | Purpose |
|---|---|---|
darwin/ |
nix-darwin | macOS system config (dock, defaults, homebrew) |
home-manager/ |
Home Manager | User packages and dotfiles (cross-platform) |
This keeps package management declarative and reproducible across environments.
allowed-users = @nix-users
build-users-group = nixbld
extra-experimental-features = nix-command flakes- Zero to Nix
- Nix Pills — Deep dive (dense but thorough)
- home-manager — Manage dotfiles with Nix
- hame-manager Option Search
- nix-darwin
- devcontainers — Container-based dev environments
- Orbstack — Fast Docker alternative for macOS
- gh repo clone