|
| 1 | +# Dotfiles |
| 2 | + |
| 3 | +A sanitized, representative slice of a personal multi-machine setup |
| 4 | +managed with **Nix** and **Home Manager**: |
| 5 | + |
| 6 | +- **t14** — NixOS on a Lenovo ThinkPad T14 (primary laptop, Hyprland desktop) |
| 7 | +- **devachine** — a remote NixOS dev box |
| 8 | +- **MacBook-Pro** — macOS via nix-darwin (shared, light personal use) |
| 9 | +- **rpi3** — a headless Raspberry Pi 3 appliance (Home Assistant) |
| 10 | + |
| 11 | +This is published as a reference for **how things are structured**, not |
| 12 | +a turnkey config. Work/personal and per-machine specifics (identities, |
| 13 | +keys, client setups) are anonymized or omitted — swap in your own. In |
| 14 | +particular, a single generic `work` context stands in for whatever real |
| 15 | +work setup you'd layer on. |
| 16 | + |
| 17 | +Secrets are never committed: they are read from 1Password at runtime |
| 18 | +(`op read`). Only **public** SSH keys appear in-repo, and here they are |
| 19 | +placeholders — replace them with your own. |
| 20 | + |
| 21 | +## Why this setup |
| 22 | + |
| 23 | +I run this because **NixOS + LLM coding agents** is a genuinely great |
| 24 | +combination, and most of this repo is built around leaning into it: |
| 25 | + |
| 26 | +- **The whole machine is declarative and in one repo.** An agent (Claude |
| 27 | + Code, Codex, the model-agnostic `pi` wrapper) can read the entire |
| 28 | + system + user config as plain text and make precise, reviewable edits — |
| 29 | + there's no hidden imperative state to reverse-engineer. |
| 30 | +- **Rebuilds are atomic and roll back.** `nixos-rebuild switch` either |
| 31 | + applies cleanly or doesn't, and every prior generation stays bootable. |
| 32 | + That makes it low-risk to let an agent touch system config: worst case |
| 33 | + you roll back a generation. |
| 34 | +- **Reproducible, so changes behave the same everywhere** — what an agent |
| 35 | + does on the t14 lands identically on the devachine. Per-project `nix` + |
| 36 | + `direnv` dev shells give agents hermetic, declared toolchains instead of |
| 37 | + "works on my machine." |
| 38 | +- **The LLM tooling itself is Nix-managed** — isolated per-account Claude |
| 39 | + Code configs (`~/.claude-dian`, `~/.claude-work`), Codex, and `pi` are |
| 40 | + all defined here and rebuilt declaratively, so the agent setup is as |
| 41 | + reproducible as everything else. |
| 42 | + |
| 43 | +## Apply config |
| 44 | + |
| 45 | +NixOS hosts: |
| 46 | + |
| 47 | +```bash |
| 48 | +nixos-rebuild switch --flake .#t14 |
| 49 | +``` |
| 50 | + |
| 51 | +macOS: |
| 52 | + |
| 53 | +```bash |
| 54 | +darwin-rebuild switch --flake .#MacBook-Pro |
| 55 | +``` |
| 56 | + |
| 57 | +Both are wrapped by a per-platform `rebuild` alias (defined in |
| 58 | +`home/darwin.nix` / `home/linux.nix`). |
| 59 | + |
| 60 | +## Layout |
| 61 | + |
| 62 | +- `flake.nix` — defines every machine's `nixosConfigurations` / |
| 63 | + `darwinConfigurations`. |
| 64 | +- `hosts/` — per-machine system config (e.g. `hosts/t14.nix`). |
| 65 | +- `home/` — user/program config; `home/common.nix` holds most program |
| 66 | + configuration shared across machines, with `home/linux.nix` / |
| 67 | + `home/darwin.nix` / `home/dev-packages.nix` layered per platform. |
| 68 | +- `zsh/`, `nvim/`, `ghostty/`, `aerospace/`, etc. — source files |
| 69 | + symlinked or copied into place by Nix. |
| 70 | + |
| 71 | +## Notes |
| 72 | + |
| 73 | +- Do not edit files under `~/.config/` or `~/.*` that are Nix-managed — |
| 74 | + they'll be overwritten on rebuild. Edit the source in this repo instead. |
0 commit comments