My personal configuration files, managed with chezmoi.
The following variables are used in generating appropriate configurations for different environments and contexts:
- Host type (
.host.type
):native
,wsl
, orcontainer
(for dev containers and possibly other containerized environments) - Host purpose (
.host.purpose
):personal
,work
, orunknown
- Operating system (
.chezmoi.os
): Windows-specific settings when applicable - Hostname (
.chezmoi.hostname
): Special handling for specific machines (e.g., personal desktop with Git signing keys)
I use the following settings provided by the VS Code Dev Containers extension:
{
"dev.containers.copyGitConfig": false,
"dotfiles.installCommand": "install-devcontainer.sh",
"dotfiles.repository": "bijancamp/dotfiles",
"dotfiles.targetPath": "~/.local/share/chezmoi"
}
These settings ensure that:
- The host's .gitconfig is not automatically copied into the container (we generate it within the container via a chezmoi template)
- This repository is cloned to the default chezmoi source path within the container
- The custom installation script is executed after the repo is cloned
Automates the initial setup of chezmoi and dotfiles within dev containers.
What it does:
- Installs chezmoi
- Initializes chezmoi for containers with purpose "unknown"
- Applies dotfiles
Usage: This script is automatically executed by VS Code when creating dev containers (via the dotfiles.installCommand
setting). Run chezmoi init --apply
after the container has finished starting to reapply the dotfiles with the necessary purpose.