Dotfiles, using chezmoi for platform independence
  • Shell 61.6%
  • Go Template 18.1%
  • Lua 18%
  • Makefile 1.7%
  • Nix 0.6%
Find a file
benmandrew 864840b72d
feat(zsh): add cpwd to copy the working directory
`pwd | xclip -sel c` carries pwd's trailing newline onto the clipboard,
so pasting the path into a prompt or a command line brings a line break
with it. cpwd writes $PWD with `print -rn`, which adds none.

It is a function rather than an alias because the same .zshrc goes to
the Mac, where there is no xclip. It picks pbcopy, wl-copy, xclip or
xsel by what is on PATH, in the same order as unbox.
2026-09-11 16:03:00 +01:00
.githooks feat(lint): render every template and lint the result 2026-09-08 16:40:20 +01:00
.github/workflows feat(ci): run gitleaks over the tree, the staged diff and the history 2026-09-08 16:16:38 +01:00
.vscode feat: Add vim global for VSCode 2026-03-13 18:39:00 +00:00
home feat(zsh): add cpwd to copy the working directory 2026-09-11 16:03:00 +01:00
scripts feat(lint): render every template and lint the result 2026-09-08 16:40:20 +01:00
.chezmoiroot feat: Move chezmoi root for home cleanliness 2026-02-09 17:10:42 +00:00
.envrc feat(direnv): install direnv + nix-direnv for automatic devShell loading 2026-07-01 13:34:38 +01:00
.gitignore chore(git): remove ai-commit-msg 2026-09-08 16:14:29 +01:00
_typos.toml feat(scripts): install git from the git-core ppa when it is too old 2026-09-03 14:07:19 +01:00
CLAUDE.md feat(claude): carry compaction summaries across /clear 2026-09-09 12:51:07 +01:00
flake.lock feat(nix): add flake.nix devShell and install_nix bootstrap 2026-06-30 22:46:44 +01:00
flake.nix feat(lint): render every template and lint the result 2026-09-08 16:40:20 +01:00
LICENCE chore: Add MIT licence 2026-03-11 16:32:39 +00:00
Makefile feat(lint): render every template and lint the result 2026-09-08 16:40:20 +01:00
README.md feat(install): bootstrap obsync under the obsidian opt-in 2026-08-17 16:15:10 +01:00
stylua.toml feat: Format lua with styleua 2026-02-09 17:26:41 +00:00
TODO.md docs: record the audit findings and what the changes rest on 2026-09-03 00:11:48 +01:00

Dependencies

The install script bootstraps all required tools for a given platform. It auto-detects the OS and architecture and delegates to the appropriate platform script.

$ ./scripts/install.sh

Optional tools

Most tools are installed on every machine. A few only make sense where you actually sit in front of the machine, rather than ssh into it — currently the Obsidian desktop app, which is what provides the obsidian CLI, and alongside it obsync and the 15-minute vault sync it schedules. Those are prompted for on first install, and the answer is remembered in ~/.config/dotfiles/optional-tools.conf so later runs stay non-interactive.

$ ./scripts/install.sh --all-optional          # take everything, no prompts
$ ./scripts/install.sh --no-optional           # take nothing, no prompts
$ ./scripts/install.sh --reconfigure-optional  # ask again

Without a terminal to prompt on, optional tools are skipped and no answer is recorded, so an unattended run never silently opts a machine out for good.

Supported platforms

These are the platforms with a tested install script. Running install.sh on anything else will exit with an error.

OS Architecture Distro
macOS ARM64
Linux x86_64 Ubuntu
Linux ARM64 Debian

Dev dependencies

$ make deps

Alternatively, if you have Nix installed (scripts/install-common.sh installs it and enables flakes via install_nix), flake.nix provides a devShell with all formatters and linters used by make fmt/make lint:

$ nix develop

chezmoi apply deploys ~/.config/nix/nix.conf (enabling flakes and setting min-free/max-free so the store auto-collects garbage instead of growing unbounded). If you installed Nix some other way and haven't run chezmoi apply, add at least this once:

experimental-features = nix-command flakes

direnv is installed by the same install script (install_direnv) and hooked into zsh, so the devShell loads automatically on cd via the checked-in .envrc — just run direnv allow once per machine. nix-direnv is also installed (install_nix_direnv) to cache the devShell so re-entering a directory is fast instead of re-evaluating the flake each time. On macOS this also installs a modern bash via Nix, since nix-direnv requires bash >= 4.4 and macOS ships 3.2.