Skip to content

shricodev/dotfiles

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

70 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

dotfiles & system setup

commit frequency

πŸ‘€ Check Out My Blog Post on this Project! (Outdated)

I have a blog post about this project here.

⚠️ NOTE: It's outdated as previously everything including dotfiles was setup using Ansible. Now, we have a mix of Stow + Ansible.

Three layers, clear boundaries: Stow for dotfiles, Ansible for system setup, mise for developer tools.

  • Stow manages all configuration files (dotfiles). Adding a new tool config is as simple as creating a directory and running stow.
  • Ansible handles system-level setup: base packages, services, Docker, fonts, terminal emulator, shell defaults - anything that is OS-specific or needs root.
  • mise manages developer tools and language runtimes (Go, Node, Python, Rust, Neovim, ripgrep, fzf, lazygit, etc.). One config file, works the same on Arch, Fedora, and Ubuntu - no more per-distro task files for dev tools.

How it works

New machine setup (one command):

bash -c "$(curl -fsSL https://raw.githubusercontent.com/shricodev/dotfiles/main/bin/dotfiles)"

This auto-detects your OS, installs Ansible, runs the playbook (which installs all packages and deploys dotfiles via stow).

Day-to-day dotfiles (no ansible needed):

# edit configs in place (already symlinked)
vim dots/nvim/.config/nvim/init.lua

# add a new tool
mkdir -p dots/wezterm/.config/wezterm
# add your config files...
stow -d dots -t ~ wezterm

πŸ“½οΈ Demo (Outdated)

You can find the demo video setting up this dotfiles configuration on multiple ubuntu homelabs here: Link

Requirements

  • Git
  • Supported OS: Arch Linux, Ubuntu, Fedora
  • (Optional) Ansible for system setup (auto-installed by the bootstrap script)
  • (Optional) Docker for testing in a container

Ansible Version Notes

Compatible with Ansible 2.20+. All system facts are accessed via ansible_facts["distribution"], ansible_facts["user_dir"], etc.

Project Structure

.
β”œβ”€β”€ dots/                      # Stow packages (dotfiles)
β”‚   β”œβ”€β”€ mise/                  #   ~/.config/mise/config.toml (dev tool list)
β”‚   β”œβ”€β”€ nvim/                  #   ~/.config/nvim/
β”‚   β”œβ”€β”€ tmux/                  #   ~/.config/tmux/
β”‚   β”œβ”€β”€ fish/                  #   ~/.config/fish/
β”‚   β”œβ”€β”€ kitty/                 #   ~/.config/kitty/
β”‚   β”œβ”€β”€ ghostty/               #   ~/.config/ghostty/
β”‚   β”œβ”€β”€ alacritty/             #   ~/.config/alacritty/
β”‚   β”œβ”€β”€ lazygit/               #   ~/.config/lazygit/
β”‚   β”œβ”€β”€ starship/              #   ~/.config/starship.toml
β”‚   β”œβ”€β”€ bat/                   #   ~/.config/bat/
β”‚   β”œβ”€β”€ zed/                   #   ~/.config/zed/
β”‚   β”œβ”€β”€ git/                   #   ~/.gitconfig, ~/.gitignore_global
β”‚   β”œβ”€β”€ gnupg/                 #   ~/.gnupg/
β”‚   β”œβ”€β”€ scripts/               #   ~/.local/bin/
β”‚   └── ...                    #   (i3, picom, polybar, gtk, etc.)
β”œβ”€β”€ ansible/                   # System automation
β”‚   β”œβ”€β”€ roles/                 #   Modular setup roles
β”‚   β”‚   β”œβ”€β”€ common/            #     Base system packages
β”‚   β”‚   β”œβ”€β”€ docker/            #     Docker engine (distro-specific)
β”‚   β”‚   β”œβ”€β”€ flatpak/           #     Flatpak runtime
β”‚   β”‚   β”œβ”€β”€ fonts/             #     System fonts
β”‚   β”‚   β”œβ”€β”€ ghostty/           #     Terminal emulator (distro-specific)
β”‚   β”‚   β”œβ”€β”€ fish/              #     Fish shell + set as default
β”‚   β”‚   β”œβ”€β”€ tmux/              #     Tmux + plugin manager
β”‚   β”‚   β”œβ”€β”€ mise/              #     Install mise + run mise install
β”‚   β”‚   β”œβ”€β”€ stow/              #     Deploy dotfiles via stow
β”‚   β”‚   └── cleanup/           #     Remove orphaned packages
β”‚   β”œβ”€β”€ pre_tasks/             #   Pre-setup tasks
β”‚   β”œβ”€β”€ group_vars/            #   Variable configurations
β”‚   β”œβ”€β”€ inventory/             #   Host inventory
β”‚   β”œβ”€β”€ configure_system.yml   #   System setup playbook
β”‚   β”œβ”€β”€ clean_up_system.yml    #   Cleanup playbook
β”‚   β”œβ”€β”€ main.yml               #   Master playbook
β”‚   └── ansible.cfg            #   Ansible config
β”œβ”€β”€ bin/
β”‚   └── dotfiles               # Bootstrap script
β”œβ”€β”€ stow.sh                    # Helper to stow/unstow all packages
β”œβ”€β”€ Taskfile.yml               # Task runner
└── Dockerfile                 # Test environment

Each stow package mirrors the home directory structure. For example:

dots/nvim/.config/nvim/init.lua  -->  ~/.config/nvim/init.lua
dots/git/.gitconfig              -->  ~/.gitconfig
dots/mise/.config/mise/config.toml --> ~/.config/mise/config.toml
dots/scripts/.local/bin/foo      -->  ~/.local/bin/foo

Architecture: What goes where?

Stow - dotfiles and configuration

Any user-facing config file: shell, editor, git, tmux, terminal, mise tool list. If it lives under ~/.config/ or ~/, it belongs in dots/.

Ansible - system-level setup

Anything that needs sudo, is OS-specific, or involves system services:

  • Base system packages (git, curl, python, htop, etc.)
  • Docker installation and service enablement
  • Flatpak runtime
  • System fonts
  • Terminal emulators with distro-specific install flows (Ghostty)
  • Setting the default shell (Fish)
  • Tmux package + plugin manager bootstrap
  • Installing the mise binary itself

mise - developer tools and runtimes

Anything that is part of the development environment and should behave the same on Arch, Fedora, and Ubuntu:

  • Language runtimes: Go, Node, Python, Rust, Bun
  • CLI tools: neovim, ripgrep, fd, bat, fzf, eza, lazygit, starship, zoxide
  • Go-based tools: air, goose, sesh, cobra-cli, delve
  • Linters: golangci-lint, sqlc
  • Infrastructure: terraform, uv

Decision rule: If it is part of the machine or OS β†’ Ansible. If it is part of your development environment β†’ mise.

Adding a new developer tool

# 1. Add to mise config
vim dots/mise/.config/mise/config.toml
# Add: "aqua:owner/repo" = "latest"

# 2. Install it
mise install

# 3. (Optional) If it has a config file, create a stow package
mkdir -p dots/toolname/.config/toolname
# Add config files, then: stow -d dots -t ~ toolname

Adding a new system package

Add it to ansible/roles/common/vars/<distro>.yml or create a new Ansible role if it needs distro-specific setup (repos, services, etc.).

Usage

Stow (dotfiles only)

# deploy all dotfiles
./stow.sh

# deploy a single package
stow -d dots -t ~ nvim

# remove symlinks
./stow.sh unstow

# re-deploy (unstow + stow)
./stow.sh restow

Ansible (system setup)

# run locally (via Taskfile)
task local

# run on remote homelabs
task ubuntu_homelabs

Update ansible/inventory/hosts.yml with your hosts and ansible/group_vars/ with your configuration.

---
all:
  children:
    ubuntu_homelabs:
      hosts:
        # <place_your_hosts_here>

    local:
      hosts:
        localhost:
          ansible_connection: local

For remote hosts, set up SSH keys and update ansible/ansible.cfg:

[defaults]
inventory = inventory/hosts.yml
private_key_file = <place_ssh_key_path_here>
roles_path = roles

Taskfile commands

Command Description
task stow Deploy all dotfiles via stow
task unstow Remove all dotfile symlinks
task restow Re-deploy all dotfiles
task mise Install all developer tools via mise
task local Run Ansible locally (your machine)
task ubuntu_homelabs Run Ansible on Ubuntu homelab machines
task docker_build Build the dotfiles Docker image
task docker_run Run the dotfiles Docker container
task docker_build_and_run Build and run the Docker container

Note

To test without installing anything on your system, run task docker_build_and_run.

Bootstrap script

bash dotfiles

This will install Ansible, clone the repo, and run the full playbook. Logs are stored in ~/.dotfiles.log.

First Run

On first run, ~/.dotfiles_first_run_check is created. The script will recommend a reboot to apply all changes.

License

Apache License, Version 2.0

About

πŸ• Fully automated dotfiles and system setup with Ansible + stow using one command. Supports Docker container testing without local changes. The never ending updates of my dotfiles config

Topics

Resources

License

Stars

Watchers

Forks

Contributors