Dotfiles managed with chezmoi.
This setup uses two separate chezmoi source states:
Main Repo
generic / shared configuration
Secrets Repo
encrypted / host-specific configuration
The separation keeps secrets out of the main repository while still allowing both repositories to behave like full chezmoi source states.
chezmoi
git
ageOptional:
zsh
tmux
nvimInitialize the generic dotfiles repository:
chezmoi init https://github.com/0x4D616E75/dotfiles.git
chezmoi apply
git@github.com:0x4D616E75/dotfiles.gitThis creates the default chezmoi source state at:
~/.local/share/chezmoiReload ZSH to enable convenience functions (cm):
source ~/.zshrcClone the secrets repository separately:
git clone https://github.com/0x4D616E75/example-dotfiles-secrets.git ~/.local/share/chezmoi-secretsCreate a separate chezmoi config directory:
mkdir -p ~/.config/chezmoi-secretsExample config:
# ~/.config/chezmoi-secrets/chezmoi.toml
encryption = "age"
[age]
identity = "~/.config/chezmoi-secrets/key.txt"Add the age identity:
mkdir -p ~/.config/chezmoi-secrets
chmod 700 ~/.config/chezmoi-secrets
$EDITOR ~/.config/chezmoi-secrets/key.txt
chmod 600 ~/.config/chezmoi-secrets/key.txtReload ZSH again to enable convenience functions (cms):
source ~/.zshrcApply the secrets repo:
cms applyGeneric dotfiles:
cm status
cm diff
cm add ~/.zshrc
cm applySecrets:
cms status
cms diff
cms add ~/.ssh/config
cms applyZed settings are rendered from a chezmoi template. Host-specific model configuration can be placed in the local chezmoi config directory:
$EDITOR ~/.config/chezmoi/zed-settings.jsoncExample:
This file stays local and keeps provider URLs, model names, and other host-specific Zed settings out of the generic dotfiles repository.
After changing it, re-render the Zed settings with:
cm diff ~/.config/zed/settings.json
cm apply ~/.config/zed/settings.jsonMain repo:
~/.zshrc
~/.vimrc
~/.tmux.conf
~/.config/nvimSecrets repo:
~/.zshenv
~/.ssh/config
~/.ssh/id_ed25519
tokens
host-specific configurationAvoid managing the same target file in both repositories.
{ // Optional. Defaults to "write" if omitted. "agent_default_profile": "ask", "default_model": { "provider": "osaurus", "model": "openai-chatgpt/gpt-5.5", }, "commit_message_model": { "provider": "osaurus", "model": "lfm2.5-8b-a1b-mxfp8", }, "openai_compatible": { "osaurus": { "api_url": "http://localhost:1337", "available_models": [ { "name": "lfm2.5-8b-a1b-mxfp8", "max_tokens": 128000, }, { "name": "openai-chatgpt/gpt-5.5", "max_tokens": 1050000, "max_output_tokens": 128000, }, ], }, }, }