1
0
Fork
You've already forked dotfiles
0
bashing my dotfiles with rage
  • Shell 100%
2025年04月18日 20:53:48 -04:00
backups vibe coded 2025年04月18日 20:53:48 -04:00
backup_dotfiles.sh vibe coded 2025年04月18日 20:53:48 -04:00
README.md vibe coded 2025年04月18日 20:53:48 -04:00
restore_dotfiles.sh vibe coded 2025年04月18日 20:53:48 -04:00

🔒 Dotfiles Backup Utility 📦

This script creates encrypted backups of essential dotfiles, those hidden configuration companions that shape our digital gardens! It plucks scattered configuration files from their native habitats and bundles them together into a single, encrypted ball of tar.

The companion script restore_dotfiles.sh allows you to decrypt and extract these backups when needed.

🧰 Requirements

  • bash shell environment
  • rage encryption tool installed
  • Age identity file at ~/personal-information-management/identity/htl-r.age

🪴 What Gets Backed Up

The script preserves the following configuration files:

  • Git configuration (~/.gitconfig, ~/.gitignore_htl)
  • Helix editor settings (~/.config/helix/config.toml, ~/.config/helix/languages.toml)
  • Nushell configuration (MacOS location:~/Library/Application Support/nushell/config.nu, ~/Library/Application Support/nushell/env.nu)
  • Zed editor settings (~/.config/zed/settings.json)
  • PostgreSQL settings (~/.psqlrc)
  • Sketchybar configuration (~/.config/sketchybar/sketchybarrc)
  • Yabai window manager settings (~/.yabairc)

🌿 Usage

Creating a Backup

Simply run the backup script from its directory:

./backup_dotfiles.sh

The backup script will:

  1. Create a timestamped backup file in the backups/ directory
  2. Skip any files that don't exist (with a warning)
  3. Clean up after itself when done

The backup script will not:

  1. Love you the way you needed when you were young
  2. Fill the air with music
  3. Check in with your friends for you

Restoring from a Backup

To restore files from a backup:

./restore_dotfiles.sh backups/dotfiles_YYYY-MM-DD.age

The restore script will:

  1. Decrypt the backup file using your identity key
  2. Extract the files to a temporary directory
  3. Show you where the extracted files are located
  4. Provide commands to help you restore all files or individual ones

The restore script will not:

  1. Soften your cynical heart
  2. Remind you that all beings are connected
  3. Promenade gaily and/or dance merrily with you in the village square

🍄 How It Works

Backup Process

  1. Creates a temporary directory to gather the dotfiles
  2. Copies each dotfile into this temporary space, preserving directory structure
  3. Creates a compressed tarball of all files
  4. Encrypts the tarball using rage and your identity file
  5. Stores the encrypted file in ./backups/ with a dated filename
  6. Removes the temporary directory

Restore Process

  1. Creates a temporary directory for working with the encrypted backup
  2. Decrypts the .age file using your identity key
  3. Extracts the tarball to a subdirectory within the temporary folder
  4. Provides clear instructions for restoring files
  5. Leaves the extracted files accessible for inspection until you manually remove them

🔖 Notes

If a configuration file is missing, the script will continue rather than failing—a practical adaptation to changing environments. Each backup creates a self-contained snapshot, like a pressed flower preserving a moment in your digital garden's evolution.

Hunter used bash to make this.