Dotfiles: Workstation Bootstrap with GNU Stow
Terminal, editor and macOS window-manager config in one repo that installs the same way on macOS and Debian: GNU Stow links it, install.sh sets the machine up, and anything machine-specific stays outside.
A single repository that holds my workstation config: terminal, editor, window manager, shell, git and ssh. The README’s first line sets the rule: “One repo, identical on every macOS and Debian machine.” Anything that belongs to one machine lives outside the repo and is attached through optional hooks.
Philosophy
Each tool gets one directory in the repo. GNU Stow symlinks that directory into the actual config location under $HOME or ~/.config. The practical consequences:
- Single source of truth. Edit config in the repo, the change is live on the system instantly.
- No copy-paste. No “copy this file to
~/.config/...” step that’s easy to forget on updates. - Reversible.
stow -Dunlinks cleanly without leaving residue. - Nothing machine-specific in git. Per-machine shell code goes in
~/.config/dotfiles/modules/*.zsh, private config comes from plugins in~/.config/dotfiles/plugins/, and files likegit/config.localor~/.config/tmux/local.confare included only if present. The repo never names what those contain.
Two files are deliberately not linked, because the app rewrites them in place: Karabiner’s karabiner.json (rules are merged into it by a script) and Claude Code’s settings.json (copied once, never overwritten).
Repo Layout
dotfiles/
├── aerospace/ # tiling window manager (macOS)
├── sketchybar/ # status bar (macOS)
├── borders/ # window borders (macOS)
├── hammerspoon/ # URL handler that opens browser links in a running nvim (macOS)
├── karabiner/ # tmux-style prefix in the browser, merged not stowed (macOS)
├── ghostty/ # terminal
├── alacritty/ # second terminal config
├── tmux/ # multiplexer
├── nvim/ # Neovim, lazy.nvim
├── vim/ # Vim fallback
├── zsh/ # .zshrc, alias files, prompt
├── git/ ssh/ # config with a local include for the per-machine part
├── claude/ # Claude Code instructions, hooks, skills
├── mise/ # version manager
├── yazi/ joshuto/ # TUI file managers
├── htop/ lynx/ nix/ rainfrog/
├── fonts/ # Blex Mono and Hack Nerd Fonts
├── docs/ # architecture, shell, secrets, git-ssh, desktop, plugins
├── Brewfile # 44 formulas, 13 casks, 6 taps
├── __scripts__/ # installers, dots-sync, secret scanner, nvim-open
├── .githooks/ # pre-commit, pre-push, post-merge
└── install.sh # bootstrap entrypoint
Bootstrap
From a fresh machine:
git clone [email protected]:arisros/dotfiles.git ~/dotfiles
cd ~/dotfiles && ./install.sh
zsh -i -c 'echo shell-ok'
install.sh detects the OS (darwin or linux) and then, in order:
- Makes sure
git,stowandcurlexist, bootstrapping Homebrew on macOS or usingapt-geton Debian. Stow is the only hard requirement. - Installs optional tools: zsh, tmux, Neovim 0.11 (pinned, because 0.12 breaks nvim-treesitter master), lazygit, ripgrep, jq, gpg, pass and a C toolchain. On Debian it also installs
__scripts__/debian-packages.txt. - Stows every package from
__scripts__/stow-map.sh. The macOS desktop packages are stowed only ondarwin. A failed package is recorded and the loop carries on. - On macOS, renders the LaunchAgent templates for SketchyBar, JankyBorders and the ssh agent, and merges the Karabiner rules.
- Runs each local plugin’s own
install.sh, sets up tmux plugins through tpm, installs the git hooks, thenmise install.
Every step checks before acting, so running it twice is safe. Each one can be switched off with an environment variable (DOTFILES_SKIP_OPTIONAL_TOOLS, DOTFILES_STOW_ADOPT and so on).
Tooling
| Layer | Tool | Notes |
|---|---|---|
| WM | AeroSpace | i3-style tiling for macOS |
| Status bar | SketchyBar | started by a LaunchAgent |
| Window border | JankyBorders | focus indicator, turns red while the browser prefix is armed |
| Keyboard | Karabiner-Elements | Home works as a tmux-style prefix in Chrome and Brave too |
| Terminal | Ghostty / Alacritty | font and window only, no shell or tmux wiring |
| Multiplexer | tmux | prefix is Home, plugins through tpm |
| Shell | Zsh | alias files per topic, local modules sourced if present |
| Editor | Neovim | Lua config under nvim/lua/arisjirat/, lazy.nvim |
| File manager | Yazi / Joshuto | TUI |
| Version manager | mise | installed from mise.run if missing |
| Secrets | pass + sandi | resolved per process, never written to disk |
The Home key, everywhere
The tmux prefix is Home, because on my keyboard Home sits under the right thumb. The repo now carries that into the browser: karabiner/tmux-browser.json makes Home arm a prefix layer in Chrome and Brave, so the same grammar works in both places. While the prefix is armed, SketchyBar shows PREFIX and the window border turns red. It falls back to idle after 2000 ms.
Secrets
There is deliberately no ~/.secrets file. Secrets live in pass, and sandi env VAR=entry -- cmd resolves them into the one process that needs them. docs/secrets.md gives the reason: a plaintext dump sourced by every shell undoes the encryption, and it silently held empty values whenever a decrypt failed. A pre-commit hook runs __scripts__/scan_secrets.sh on what is staged, because by push time a secret is already in the history.
Brewfile
Brewfile is the package manifest, tracked in git so installs are reproducible:
tap "felixkratz/formulae" # sketchybar, borders
tap "nikitabobko/tap" # aerospace
brew "neovim"
brew "tmux"
brew "stow"
brew "pass"
...
cask "aerospace"
cask "hammerspoon"
cask "karabiner-elements"
...
install.sh does not apply it; brew bundle is a separate, deliberate step. On Debian, __scripts__/brew-leaves.txt (exported on the Mac) is mapped to apt equivalents instead.
Update Workflow
Config edits are live immediately, because the files are symlinks:
nvim ~/dotfiles/nvim/lua/arisjirat/core/keymaps.lua
cd ~/dotfiles && git add -p && git commit && git push
On another machine, git pull is enough. The post-merge hook runs __scripts__/dots-sync.sh, which re-stows, merges the Karabiner rules, updates tmux plugins, reloads a running tmux and pulls the zsh plugins and local plugins. CI runs shellcheck on every script.
Status
Active repo, used daily, changed whenever a tool comes in or goes out. Recent removals: the opencode config and the herdr integration.