Skip to content

n3ddu8/dotfiles

Repository files navigation

💪 More than just dotfiles...

Welcome to the repo where dotfiles go to evolve, packages get installed without drama, and Chezmoi becomes the declarative deity of your system setup. If you're here expecting a humble .bashrc and a couple of aliases, you're in for a surprise. This is not a dotfiles repo. This is a lifestyle.

🚀 What Is This?

This repo uses Chezmoi as the single source of truth for:

  • 📂 Dotfiles (obviously)
  • 📦 Package management (Homebrew, apt, pip, flatpak, and even GitHub CLI extensions)
  • 🧠 Declarative system setup across multiple profiles
  • ✈️ Preflight checks that actually do something
  • 🧵 Modular YAML-driven orchestration that would make Ansible blush

🧩 How It Works (Semi-Seriously)

Chezmoi reads from a constellation of .chezmoidata/*.yaml files to determine what packages to install, which managers to use, and how to behave based on your machine’s hostname. It’s like Hogwarts for sysadmins.

📁 .chezmoidata/commands.yaml

Defines how each package manager installs things. Think of it as the sacred scroll of install incantations:

brew:
  install:
  - brew install
gh:
  preflight: |
    if ! gh auth status &>/dev/null; then
      echo "🔐 GitHub CLI not authenticated. Initiating login..."
      ...
    fi
  install:
  - gh extension install

Yes, we run preflight checks. Yes, they’re real. Yes, they involve ssh-keyscan. You're welcome.

📦 .chezmoidata/packages.yaml

Specifies what each group should install with each manager. You fill in the blanks. I won’t judge your choice of CLI tools.

packages:
  common:
    brew:
    - htop
    - jq
    gh:
    - copilot
    pip:
    - rich

🧬 .chezmoidata/profiles.yaml

Maps hostnames to profiles. Profiles are just bundles of groups. Groups are bundles of packages. Packages are bundles of joy.

profiles:
  zeus:
  - machost
  devcontainer:
  - common

Your hostname determines your destiny. If it’s not found, you get the devcontainer profile. It’s like the sorting hat, but with fewer hats.

🛠️ run_onchange-install-packages.sh.tmpl

This is the bash-powered engine that ties it all together. It:

  1. Resolves your profile based on hostname
  2. Loops through each group
  3. Runs preflight checks (once per manager)
  4. Installs packages with the correct command
  5. Logs everything with emoji-powered commentary
echo "🚀 Applying profile for: {{ $profile }}"
echo -n "📦 Resolved groups:"
...
echo "🔧 Processing group: {{ $group }}"

🤔 Why Chezmoi?

Because Ansible is overkill, Bash is underkill, and Chezmoi is just right. It’s reproducible, declarative, and doesn’t make you write 200 lines of YAML to install htop.

💭 Final Thoughts

This repo is designed to be:

  • Atomic (no manual steps)
  • Reproducible (same result every time)
  • Declarative (YAML all the way down)
  • Playful (because life’s too short for boring dotfiles)