Personal dotfiles managed with chezmoi and doppler.
I store the below secrets in Doppler:
- AWS SSO account details
- Azure DevOps account details
- git user name and email
- kubeconfig and some custom kubernetes aliases
- SSH keys: RSA and ED25519
- wakapi API key and URL
I store sensitive files for my Windows machine in an AWS S3 bucket. For more details, go to the Microsoft Windows section.
-
Generate a Doppler service token valid for 30 minutes, following the official documentation available here.
-
Export required environment variables:
export GITHUB_USERNAME=clement-deltel
# Machine configuration. Options: pro, perso
export MACHINE=pro
# Linux distribution family. Options: arch, debian, nixos, redhat
export FAMILY=debian
# Set ephemeral Doppler service token
export DOPPLER_TOKEN=''- Install dependencies:
# Debian-like Systems
sudo apt update -y && sudo apt install -y curl
# RedHat-like Systems
sudo yum update -y && sudo yum install -y curl
# Arch
# NixOS- Run installation script:
curl -fsSL https://raw.githubusercontent.com/${GITHUB_USERNAME}/dotfiles/refs/heads/main/docker/linux/${FAMILY}/install.sh | bash- After pulling and configuring the dotfiles, chezmoi run a script installing ansible, and then running playbooks.
- Ansible playbooks automatically install and configure these apps.
- Clear service token and establish a proper connection:
unset DOPPLER_TOKEN
doppler login --scope /- If needed, run this extra playbook to pull quite handy base images:
# Pull Docker images: archlinux, centos, debian, fedora, mongodb, nixos, postgis, postgres, rabbitmq, redis, ubuntu
ansible-playbook --become --connection local --inventory "localhost," --tags init ~/ansible/orchestration/images.ymlRun the command below to refresh the configuration after an update on the repository:
chezmoi update
# or the alias
cmu- Export required environment variables:
export GITHUB_USERNAME=clement-deltel
# Machine configuration. Options: pro, perso
export MACHINE=pro
# Set image parameters
export FAMILY=debian
export IMAGE=ubuntu:24.04
# See all options and more details at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
export TIMEZONE=Etc/GMT
# Generate ephemeral Doppler service token
DURATION=30m
export DOPPLER_TOKEN=$(doppler configs tokens create dotfiles-install -p dotfiles -c prod_${MACHINE} --max-age ${DURATION} --plain)- Build Docker image:
# Docker build and then run
# Use option --progress=plain to see steps in more details
docker build --build-arg GITHUB_USERNAME --build-arg MACHINE --build-arg IMAGE --build-arg TIMEZONE --build-arg DOPPLER_TOKEN --file docker/linux/${FAMILY}/Dockerfile --tag ${IMAGE}-dotfiles-dev --target development docker/linux/${FAMILY}/
unset DOPPLER_TOKEN- Run a container:
docker run --interactive --name dotfiles-dev --tty --rm ${IMAGE}-dotfiles-dev
# --volume ~/.local/share/chezmoi:/home/linux/.local/share/chezmoi --workdir /home/linux/.local/share/chezmoi/homeNote: to troubleshoot individual playbooks, enable volume and workdir options, copy private_main.yml.tmpl to main.yml and remove go template blocks.
- Run the chezmoi init command:
exec $HOME/.local/bin/chezmoi init --apply ${GITHUB_USERNAME}- Install Docker to test this setup. The following images have been tested so far:
- Debian-like Systems
- ubuntu:22.04
- ubuntu:24.04
- Export required environment variables:
export GITHUB_USERNAME=clement-deltel
# Machine configuration. Options: pro, perso
export MACHINE=pro
# Set image parameters
FAMILY=debian
export IMAGE=ubuntu:24.04
# See all options and more details at https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
export TIMEZONE=Etc/GMT
# Generate ephemeral Doppler service token
DURATION=30m
export DOPPLER_TOKEN=$(doppler configs tokens create dotfiles-install -p dotfiles -c prod_${MACHINE} --max-age ${DURATION} --plain)- Build Docker image:
# Docker build and then run
# Use option --progress=plain to see steps in more details
docker build --build-arg GITHUB_USERNAME --build-arg MACHINE --build-arg IMAGE --build-arg TIMEZONE --build-arg DOPPLER_TOKEN --file docker/linux/${FAMILY}/Dockerfile --tag ${IMAGE}-dotfiles --target production docker/linux/${FAMILY}/
unset DOPPLER_TOKEN- Run a container:
docker run --interactive --name dotfiles --tty --rm ${IMAGE}-dotfiles- The following images have not been tested so far:
- Debian-like Systems
- debian:12:10
- ubuntu:26.04
- RedHat-like Systems
- quay.io/centos/centos:10
- fedora:42
- redhat/ubi10:10.0
- ArchLinux
- archlinux:base-20250302.0.316047
- NixOS
- nixos/nix:2.27.1
- Export required environment variables:
# Machine configuration. Options: pro, perso
export MACHINE=pro
# Set image parameters
IMAGE=ubuntu:26.04
# Generate ephemeral Doppler service token
DURATION=30m
export DOPPLER_TOKEN=$(doppler configs tokens create dotfiles-install -p dotfiles -c prod_${MACHINE} --max-age ${DURATION} --plain)- Run a container:
docker run --env GITHUB_USERNAME=clement-deltel --env MACHINE --env DOPPLER_TOKEN --interactive --name dotfiles --tty --rm ${IMAGE} bash- Update and install packages, set linux user:
apt update -y && apt install -y curl sudo
groupadd --gid 10001 linux
useradd --create-home --gid 10001 --home /home/linux --shell /bin/bash --uid 10001 linux
usermod -aG sudo linux && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
su linux-
Generate a Doppler service token valid for 30 minutes, following the official documentation available here.
-
Export required environment variables:
$Env:GITHUB_USERNAME=clement-deltel
# Machine configuration. Options: pro, perso
$Env:MACHINE=pro
# Set ephemeral Doppler service token
$Env:$DOPPLER_TOKEN=""- Run installation script:
curl -fsSL https://raw.githubusercontent.com/clement-deltel/dotfiles/refs/heads/main/docker/microsoft/install.sh | powershell-
After pulling and configuring the dotfiles, chezmoi run several powershell scripts, executing the steps below:
-
Chocolatey install and configure these apps.
-
Winget install and configure these apps.
-
chezmoi also restore some files from backups stored in AWS S3:
- Google Chrome
- Outlook Signatures
- Windows Explorer - Quick Access
- Windows Start Menu
- Windows Subsystem for Linux (WSL)
- Windows Taskbar
-
Finally, install the softwares requiring manual effort.
-
Clear service token and establish a proper connection:
$Env:DOPPLER_TOKEN=$null
doppler login --scope C:\Install Docker to test this setup.
Then, build an image:
$Env:GITHUB_USERNAME=clement-deltel
# Machine configuration. Options: pro, perso
$Env:MACHINE=pro
# Update with your Doppler CLI token
$Env:$DOPPLER_TOKEN=""
# Docker build and then run
# Use option --progress=plain to see steps in more details
docker build --build-arg GITHUB_USERNAME --build-arg MACHINE --build-arg DOPPLER_TOKEN --file docker/microsoft/Dockerfile --tag dotfiles docker/microsoft/
$Env:DOPPLER_TOKEN=$nullAnd run a container:
docker run --interactive --name dotfiles --tty --rm dotfilesTo be tested:
docker run --interactive --name dotfiles --tty --rm mcr.microsoft.com/windows/nanoserver:ltsc2022 powershellI am still figuring out a way to install these extensions programmatically.