Generic, idempotent Coder workspace bootstrap: pinned and checksum-verified tools, safe shell/git setup, personal config kept out of the repo
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
John 6edfa37c20
All checks were successful
Dotfiles CI / test (push) Successful in 16s
Merge pull request 'feat: install pinned GitHub CLI (gh 2.106.0)' (#7) from feat/gh-cli into main
Reviewed-on: #7
2026-11-28 13:31:50 +00:00
.forgejo/workflows Onboard shared Code Architecture workflow (#5) 2026-11-21 13:50:37 +00:00
examples feat: install pinned GitHub CLI (gh 2.106.0) 2026-11-28 13:30:43 +00:00
scripts feat: install pinned GitHub CLI (gh 2.106.0) 2026-11-28 13:30:43 +00:00
shell feat: install pinned GitHub CLI (gh 2.106.0) 2026-11-28 13:30:43 +00:00
tests feat: install pinned GitHub CLI (gh 2.106.0) 2026-11-28 13:30:43 +00:00
.gitignore Coder workspace dotfiles: generic, idempotent bootstrap 2026-11-16 14:20:25 +00:00
install.sh feat: install pinned GitHub CLI (gh 2.106.0) 2026-11-28 13:30:43 +00:00
LICENSE Coder workspace dotfiles: generic, idempotent bootstrap 2026-11-16 14:20:25 +00:00
README.md feat: install pinned GitHub CLI (gh 2.106.0) 2026-11-28 13:30:43 +00:00
versions.env feat: install pinned GitHub CLI (gh 2.106.0) 2026-11-28 13:30:43 +00:00
yawn.json feat: install pinned GitHub CLI (gh 2.106.0) 2026-11-28 13:30:43 +00:00

dotfiles

A small, auditable bootstrap for Coder workspaces and other Linux homes. Coder's Dotfiles step runs coder dotfiles on every workspace start: it clones this repo into ~/.config/coderv2/dotfiles the first time, runs git pull --ff-only on later starts, and then runs install.sh. Every step is idempotent, so running it on each start is cheap and safe.

The repo itself is generic. Everything personal (hosts, repos, signing keys, secrets to check for) lives in ~/.config/dotfiles/, which is never committed.

What install.sh does

Step What it touches Safety
Shell Adds one marked block to ~/.bashrc that sources shell/bashrc.sh (PATH for ~/.local/bin, ~/go/bin, ~/bin; completions; your bashrc.sh) Rest of ~/.bashrc is never changed
Git Adds include.path for shell/gitconfig (generic defaults) and your gitconfig at the top of ~/.gitconfig Existing ~/.gitconfig settings keep priority
SSH host keys Appends your pinned known_hosts entries to ~/.ssh/known_hosts A different existing key is reported, never overwritten
Tools Forgejo CLI (fj), GitHub CLI (gh), OpenTofu, Node.js, Go and the Oracle CLI into ~/.local/opt/<tool>-<version>, linked from ~/.local/bin Versions and SHA-256 (amd64 + arm64) pinned in versions.env; a mismatch aborts. No sudo
Repos Clones any missing entry in your repos.txt into $HOME Existing checkouts are not pulled or reset
Services Starts scripts listed in DOTFILES_SERVICES that are not already running Workspace images usually have no cron, so this is what restarts them
Secrets Lists any file in your secrets.txt that is missing Reports paths only; stores, fetches and prints nothing

With no personal config at all, you get the shell setup, git defaults and the tools. The repo, service and secret steps do nothing until you configure them.

Use it

  1. Fork or copy this repo (or use it as is).

  2. In your Coder workspace parameters, set Dotfiles URL to its clone URL, for example https://code.yawn.dev/john/dotfiles.git. Changing a parameter on an existing workspace restarts it, so do it when idle. This repo is public, so HTTPS needs no login.

  3. Optionally add personal config:

    mkdir -p -m 700 ~/.config/dotfiles
    cp ~/.config/coderv2/dotfiles/examples/local.env ~/.config/dotfiles/
    # ...and any of gitconfig, repos.txt, secrets.txt, known_hosts; then edit them
    ~/.config/coderv2/dotfiles/install.sh
    

Without Coder, clone the repo anywhere and run ./install.sh.

coder dotfiles passes StrictHostKeyChecking=no to its own clone and pull of this repo. That is Coder's behaviour, not something this repo controls, and it is another reason to use an HTTPS URL.

Personal config (~/.config/dotfiles/)

File Purpose Example
local.env Settings for every step: git host, tools list, services, skip flags examples/local.env
gitconfig Credential helpers, commit signing examples/gitconfig
repos.txt Repositories to clone examples/repos.txt
secrets.txt Files to check for (never read) examples/secrets.txt
known_hosts SSH host keys to pin examples/known_hosts
bashrc.sh Personal aliases and exports, sourced last —

Set DOTFILES_CONFIG to use a different directory. Keep this directory private: in a new workspace, copy it in together with your secrets, or keep it in a separate private repo.

Secrets

No secrets live in this repo, and none should. SSH keys, cloud credentials and CLI logins stay in the workspace's persistent home volume. List them in secrets.txt so a new workspace tells you what to copy in. CI fails if anything that looks like a key or token is committed.

Changing things

  • Bump a tool: edit its version and both checksums in versions.env, taken from the upstream checksum file listed there. Old versions stay in ~/.local/opt until you delete them.
  • Tests: bash tests/test_install.sh runs install.sh twice against a throwaway HOME, with and without personal config. It checks the script is idempotent, keeps existing config, refuses bad checksums and conflicting host keys, and that the repo contains no secrets. CI runs this and ShellCheck; dispatch CI with tools=true to also download and verify every pinned tool.

Licence

MIT