Repository Tree
Directory Breakdown
/ansible/ - System Configuration
Ansible playbooks and roles for system-level package installation and configuration.
group_vars/all.yml
Centralized data-driven configuration file defining all packages and repositories.
External Repositories:
roles/common/tasks/main.yml
Universal installation role that handles:
- GPG key download and de-armoring
- APT repository configuration
- Package installation (apt and snap)
- Passwordless sudo configuration
- Download GPG keys and convert to binary format
- Add external repositories to apt sources
- Install all packages from
workstation_packageslist - Install snap packages
- Configure sudoers for passwordless sudo
roles/gnome/tasks/
GNOME desktop environment configuration using dconf.
Settings configured:
- Color scheme: Dark mode
- Clock: Show date, hide seconds
- Power management: Disable sleep on AC power
site.yml
Main Ansible playbook that orchestrates role execution:
/tests/ - Automated Testing
Integration tests for CI/CD and local verification.
| File | Purpose |
|---|---|
run-all.sh | Executes all test scripts in sequence |
test-dotfiles.sh | Verifies dotfiles are applied (~/.bash_aliases, ~/.gitconfig, etc.) |
test-packages.sh | Checks that required packages are installed |
test-age-key.sh | Validates age key exists with correct permissions (600) |
fixtures/bw-data.json | Mock Bitwarden vault data for testing |
mocks/bw | Mock Bitwarden CLI for CI environments |
/private_dot_ssh/ - SSH Configuration
SSH keys and configuration files, encrypted with age.
Naming convention:
private_prefix = encrypted file (requires age key to decrypt).tmplsuffix = template file (processed by chezmoi with variables)
private_yurgenlira.tmpl- Private SSH key (encrypted)private_yurgenlira.pub.tmpl- Public SSH key (encrypted)
/dot_aws/ - AWS Configuration
AWS CLI configuration and credentials, sourced from Bitwarden.
Files:
private_config.tmpl- AWS config file (~/.aws/config)private_credentials.tmpl- AWS credentials file (~/.aws/credentials)
bitwardenFields function.
Root-level Files
.chezmoi.toml.tmpl
Chezmoi configuration file with interactive prompts and encryption setup.
Prompts:
- Name (default: “Julio Lira”)
- Machine type (personal/work/hybrid)
- Operating system (default: linux)
- Default editor (default: code)
- Personal email (if personal or hybrid)
- Work email (if work or hybrid)
- Edit: Opens files in VS Code with
--wait - Diff: Opens diffs in VS Code
- Merge: Uses VS Code merge tool
bootstrap.sh
One-shot installation script. See Bootstrap Script Reference for details.
run_once_after_ansible.sh.tmpl
Executed once after dotfiles are applied. Runs the Ansible playbook to configure the system.
run_once_prefix = Execute only once (chezmoi tracks execution)_after_= Run after all other files are applied
Chezmoi Naming Conventions
Chezmoi uses special prefixes and suffixes to control file behavior:| Pattern | Result | Example |
|---|---|---|
dot_ | Adds . prefix | dot_bashrc → ~/.bashrc |
private_ | Sets 600 permissions | private_key → readable only by owner |
executable_ | Sets 755 permissions | executable_script.sh → executable |
run_once_ | Executes once | Tracked in chezmoi state |
run_after_ | Runs after file apply | Executed in order |
.tmpl | Template file | Processed with Go templates |
.age | Encrypted file | Decrypted with age key |
- Directory becomes
~/.ssh/(private + hidden) - File is processed as template
- Result:
~/.ssh/yurgenlirawith 600 permissions
Data Flow
- Bootstrap installs tools and sets up age key
- Chezmoi init clones repository and prompts for config
- Chezmoi apply processes templates and decrypts files
- Bitwarden provides secrets (SSH keys, AWS credentials)
- Age decrypts sensitive files using
~/.config/chezmoi/key.txt - Ansible runs after dotfiles are applied to configure system packages and settings
Adding New Files
Add a new package
Editansible/group_vars/all.yml and add to workstation_packages list. Update tests/test-packages.sh to verify installation.
Add a new dotfile
Use chezmoi to add files from your home directory:Add a new external repository
Add entry toexternal_repositories in ansible/group_vars/all.yml with key_url, repo, and keyring fields. The common role will automatically handle GPG key installation.