FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

dotfiles/profiles at main · STiXzoOR/dotfiles · GitHub

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Machine Profiles

This directory contains machine-specific configurations that are loaded based on the hostname or a profile name.

How It Works

  1. Create a profile file named after your machine's hostname or a custom name:

    • profiles/work.zsh - Work machine profile
    • profiles/personal.zsh - Personal machine profile
    • profiles/MacBook-Pro.zsh - Hostname-based profile
  2. Set the DOTFILES_PROFILE environment variable (optional):

    export DOTFILES_PROFILE="work"
  3. If DOTFILES_PROFILE is not set, the system will try to load a profile matching your hostname.

Profile Loading Order

  1. profiles/default.zsh (always loaded if exists)
  2. profiles/$DOTFILES_PROFILE.zsh OR profiles/$(hostname -s).zsh
  3. profiles/local.zsh (always loaded if exists, for machine-specific overrides)

Post-Prezto Profiles (*.post.zsh)

profiles/*.zsh are sourced from .zprofile, which runs before Prezto and therefore before compinit. Anything that needs compdef has to go in a .post.zsh file instead; runcom/.zshrc sources those at the very end, after Prezto:

  1. profiles/$DOTFILES_LOADED_PROFILE.post.zsh
  2. profiles/local.post.zsh

Put here anything that registers completions or key bindings:

# profiles/local.post.zsh

# gcloud completion. Sourced from .zprofile this runs a second full compinit,
# because the guard inside completion.zsh.inc only short-circuits once compdef
# exists.
source "$HOME/google-cloud-sdk/completion.zsh.inc"

# Any other `<tool> init zsh` or `<tool> completion zsh` output.

PATH additions do not belong here. .zprofile normalises and deduplicates PATH right after .profile returns, so an entry added from a .post.zsh file escapes both the /../ cleanup and typeset -U. Keep those in the plain *.zsh profile, which runs before that step — gcloud's path.zsh.inc stays in local.zsh, and only completion.zsh.inc moves.

Example Profile

# profiles/work.zsh

# Work-specific Git configuration
export GIT_AUTHOR_EMAIL="you@company.com"
export GIT_COMMITTER_EMAIL="you@company.com"

# Work-specific aliases
alias vpn="open /Applications/CompanyVPN.app"
alias jira="open https://company.atlassian.net"

# Work proxy settings
# export http_proxy="http://proxy.company.com:8080"

# Additional PATH entries
prepend-path "$HOME/work/scripts"

# Load work-specific Brewfile
# export HOMEBREW_BUNDLE_FILE="$DOTFILES_DIR/profiles/Brewfile.work"

Files

  • default.zsh - Base settings loaded on all machines
  • personal.zsh - Personal machine settings
  • work.zsh - Work machine settings
  • local.zsh - Machine-specific overrides (gitignored)

Back | FazBrowse Home | New Git URL