Skip to content

Repository files navigation

git clone --depth 1 https://github.com/levontumanyan/home_directory
./install.sh

Testing

Test install.sh in a clean Linux environment using the devcontainer image (requires Apple's native container tool):

container run --rm -it \
  -v ~/repos/home_directory:/workspaces/home_directory \
  -w /workspaces/home_directory \
  dotfiles-test \
  zsh

--rm destroys the container on exit so each run starts from a clean slate. Once inside:

./install.sh

To rebuild the image after changing .devcontainer/Containerfile or .devcontainer/devcontainer.json, run make build-test.

Keeping Brewfiles updated

After installing new packages on a machine, snapshot the current state back into the repo so other machines stay in sync.

Work machine:

brew bundle dump --force --file=brewfile_work

Personal machine:

brew bundle dump --force --file=brewfile_personal

Then commit and push. The dump overwrites the file with everything currently installed via Homebrew — formulas, casks, taps, and VS Code extensions.

Note: brew bundle dump outputs everything flat. Casks and macOS-only formulas will be included without any Linux guards — that's expected, the Brewfiles are macOS-first.

Manually make sure that iterm looks at this dir for its settings: ~/.config/iterm

Symlink management (stow)

Symlinks are managed with GNU Stow. Stow mirrors a package directory tree into a target ($HOME), creating one symlink per file. It errors out rather than silently overwriting real files, and -D cleanly reverses everything.

Package structure

dotfiles/
  base/             # stowed on all machines
  os/darwin/        # stowed on macOS only
  os/linux/         # stowed on Linux only
  profile/work/     # stowed on work machines
  profile/personal/ # stowed on personal machines

Each package mirrors the layout of $HOME. For example:

  • dotfiles/base/.zshrc~/.zshrc
  • dotfiles/os/darwin/.config/iterm/com.googlecode.iterm2.plist~/.config/iterm/com.googlecode.iterm2.plist
  • dotfiles/profile/work/.work.zsh~/.work.zsh

Adding a new dotfile

  1. Create the file at the mirrored path inside dotfiles/base/:
    • ~/.config/foo/bar.confdotfiles/base/.config/foo/bar.conf
  2. Re-run install.sh, or restow manually:
    stow --dir="$DOTFILES_DIR/dotfiles" --target="$HOME" --restow base
  3. Commit and push.

For work-only files, use dotfiles/profile/work/ instead.

Removing a dotfile

  1. Delete the file from the appropriate layer (dotfiles/base/, dotfiles/os/<platform>/, or dotfiles/profile/<type>/).
  2. Restow to clean up the orphaned symlink:
    stow --dir="$DOTFILES_DIR/dotfiles" --target="$HOME" --restow base
  3. Commit and push.

proposed fixes

Proposed fixes

  1. setup_envs.sh: Remove the broken BACKUP_FILES (already covered by the explicit loop in install.sh)
  2. install.sh: Save the backup path to ~/.dotfiles_last_backup after backing up
  3. uninstall.sh: Read ~/.dotfiles_last_backup to find the correct backup dir to restore from

Todo:

  • restoring from backups is broken
  • create .claude/settings.json
    • add skills
    • gh issue view* safe to run
  • make sure there is an option to run the script completely uninteractively for testing/debugging
  • better ps1(include git branching, and kubecontext)
  • move k8s functions to it's own thing. Follow Stick convention for this!
  • idempotency is kinda broken
  • fzf everything - what does that even mean. not just history?
  • ownership of the files in this repo (root?)
  • add history settings
  • put buckups in one dir...clean up backup files after 3 iterations

backup homedir

sudo rsync -a --progress --exclude=".local/" --exclude=".vscode-remote/" "$HOME/" "./backup/"

cron command for brew casks and formulas to be backed up

          • /Users/levontumanyan/home_directory/brew_cron.sh >> /tmp/brew_cron.log 2>&1

info

Macos install stuff requires sudo!

Homebrew not found, installing... - after this line you will need your sudo password to install brew!

git config setup for commit signing

git config --global user.signingkey <YOUR_SIGNING_SUBKEY_ID>
git config --global commit.gpgsign true
git config --global tag.gpgsign true

\n- [ ] TODO: Migrate ~/.gitconfig to dotfiles/base/ and verify GPG keys before removing HOME .git

About

Dot files and home directory setup

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages