A Home Manager-based dotfiles setup for macOS and Arch Linux.
| Path | Contents |
|---|---|
flake.nix | Home Manager flake (inputs and targets) |
home/ | Home Manager modules (*.nix) |
config/ | Nix configuration (nix.conf, enables flakes) |
bin/ | Custom scripts deployed to ~~/.local/bin/~ |
emacs/ | Doom Emacs configuration (config.org) |
claude/ | Global Claude Code configuration |
kitty/ | Kitty terminal configuration |
byobu/ | Byobu configuration |
hypr/ | Hyprland configuration (Arch only) |
sway/ | Sway configuration (Arch only) |
walker/ | Walker launcher (Arch only) |
wayvnc/ | Wayvnc configuration (Arch only) |
systemd/ | Systemd user services (Arch only) |
plover/ | Plover stenography configuration |
opencode/ | OpenCode AI configuration |
sbt/ | SBT build tool configuration |
zsh/ | ZSH/p10k configuration |
idea/ | IdeaVim configuration |
clang/ | CMake toolchain files |
- Git (to clone this repo)
- Nix package manager
Run the single bootstrap script — it detects the host automatically:
./bootstrap.shThe script will walk through each step interactively:
- Install Nix (
curlon macOS,yayon Arch) - Enable the Nix daemon (Arch only)
- Link
config/to ~~/.config/nix~ (enables flakes) - Build and switch to the Home Manager configuration
- Clone and install Doom Emacs into ~~/.emacs.doom/~
Home Manager refuses to overwrite unmanaged files.
Use the -b backup flag on first switch to let it keep backups of existing files:
home-manager switch -b backup --flake .#ista-dotfileshome-manager build --flake .#ista-dotfilesRun the upgrade script to pull the latest dotfiles, apply the Home Manager configuration, and update Doom Emacs:
~/.local/bin/system-upgrade.shbin/system-upgrade.sh --reviewFor a nonstandard checkout location, set DOTFILES_DIR when using the installed
script. Requires Python 3 and OpenCode 2.x. After the upgrade, this previews only failed
steps’ stderr and unread, relevant Home Manager news (newest first, size-limited).
Stdout and successful steps’ stderr are excluded. News is not marked as read.
Common credential patterns and secret-valued environment variables are redacted, but redaction is best-effort: inspect the preview before approving upload. Without explicit terminal confirmation, nothing is sent. Normal terminal output is unchanged; do not assume it is safe to share. Temporary captures are private and removed on normal exit.
The review uses an isolated, tool-denied OpenCode instance and never applies its
recommendations. Review failure does not change the upgrade’s exit status.
The model defaults to the global OpenCode model setting; override it with
SYSTEM_UPGRADE_REVIEW_MODEL=provider/model. The approved report is stored in
OpenCode’s session history as well as sent to the selected provider.
Offline tests (no package upgrades or model requests):
PYTHONDONTWRITEBYTECODE=1 python3 bin/tests/test-system-upgrade-review.py| Target | Host | Platform |
|---|---|---|
ista-dotfiles | deess1mac* | macOS (aarch64-darwin) |
akiko-dotfiles | akiko* | Arch Linux (x86_64-linux) |
A brief glossary for the concepts used in this repo.
A purely functional package manager and build system.
Packages are built in isolation and stored in the /nix/store (e.g. /nix/store/abc123-emacs-29.4/).
Nothing is installed globally; everything is linked or referenced from there.
A self-contained Nix project with pinned inputs and declared outputs.
nix/flake.nix is this repo’s flake — it declares all external dependencies (nixpkgs, home-manager, powerlevel10k, etc.) and the two Home Manager configurations as outputs.
nix/flake.lock pins every input to an exact git revision, making builds reproducible.
An external source (git repo, tarball) that the flake depends on.
Inputs with flake = false are plain repos without their own flake.nix, consumed as raw file trees (e.g. chemacs2, powerlevel10k).
A tool that applies a Nix configuration to a user’s home directory.
It manages dotfiles, shell config, and some programs declaratively — the home.file attribute set maps source files to $HOME paths as read-only symlinks into the Nix store.
Declares a symlink from a source file (in the repo or Nix store) into $HOME.
Files managed this way are read-only; Home Manager owns them.
Higher-level Home Manager modules (e.g. programs.zsh, programs.tmux, programs.git) that generate config files and wire up shell integration automatically.
Running home-manager switch compares the current generation with the new one and atomically applies the diff: it creates/removes symlinks, installs packages, and runs any activation scripts.
| Command | Purpose |
|---|---|
home-manager switch --flake .#ista-dotfiles | Build the configuration and activate it (creates a new generation). |
home-manager build --flake .#ista-dotfiles | Build only; produces a result symlink without touching $HOME. |
home-manager switch -b backup --flake .#... | First-time switch — back up unmanaged files that would collide. |
home-manager generations | List previous generations with timestamps and store paths. |
/nix/var/nix/profiles/per-user/$USER/home-manager-N-link/activate | Roll back by activating an older generation directly. |
home-manager news --flake .#ista-dotfiles | Show news entries from modules (breaking changes, deprecations). |
home-manager expire-generations '-30 days' | Delete generations older than the cutoff. |
nix flake update | Refresh all flake inputs (nixpkgs, home-manager, etc.) in flake.lock. |
nix flake lock --update-input nixpkgs | Update a single input only. |
nix-collect-garbage -d | Garbage-collect old store paths after expiring generations. |
Replace ista-dotfiles with akiko-dotfiles on Arch Linux.
password-store.nix wires ~~/.password-store~ to a self-hosted bare git repo on each home-manager switch.
gpgavailable onPATH(installed viahome.packages).- At least one GPG secret key imported. Activation fails loudly if no secret key is present. Follow-up: gbastkowski/dotfiles#35 tracks adding GPG init to bootstrap.
- On a machine without ~~/.password-store~: clones the remote.
- On a machine with the store but no
origin: adds the configured remote. - On a machine with a mismatched
origin: aborts the switch. - Otherwise: silent no-op.
Sync is manual. After making changes on one machine:
pass git pushOn another machine, before reading or editing secrets:
pass git pullThe GitHub MCP server (https://api.githubcopilot.com/mcp/) authenticates with a fine-grained personal access token, not OAuth — its auth server does not support dynamic client registration, so /mcp in-app auth fails.
The token is kept out of the config and out of git:
- Stored in
password-storeundergithub.com/mcp-token. zsh.nixexports it asGITHUB_MCP_PATon shell start (pass show github.com/mcp-token).- ~~/.claude.json~ references it in the server’s
Authorizationheader asBearer ${GITHUB_MCP_PAT}; Claude Code expands the variable at launch.
- Create a fine-grained token at https://github.com/settings/tokens (Metadata read; Contents/Issues/Pull requests read or write as needed).
- Store it:
pass insert -f github.com/mcp-token. - Launch Claude Code from a fresh shell so
GITHUB_MCP_PATis in the environment.
Replace the secret and restart Claude Code — no config change needed:
pass insert -f github.com/mcp-tokenemacs/.doom.d/is linked file-by-file so that ~~/.doom.d~ remains a writable directory (required bydoom sync).emacs/.emacs.doom/(Doom Emacs itself) is cloned independently bybootstrap.sh, not managed by Home Manager.ista-dotfilesis a private repo included as a Nix flake input (not a submodule).config/nix.confenables flakes and must be linked to ~~/.config/nix~ before running any nix commands.bootstrap.shhandles this.- After a gcc or libgccjit upgrade, re-run
doom envto refresh the environment snapshot for GUI Emacs.