diff --git a/README.md b/README.md index 85f9649..2872664 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,14 @@ # repo containing configs and scripts to set up a box ### prerequisites +- git is installed (to clone repo below, consider adding logic to handle automatically) - zsh is installed (scripts are written for zsh) -- git is installed + - ensure ZDOTDIR is set in a persistent way for system (not just setup scripts) + - current approach: add `export ZDOTDIR="$HOME/.config/zsh"` to `/etc/zshenv` - export the env var `BOX_SETUP_OS` to indicate the operating system - options defined in `set_env_vars` file - if on macOS, install [homebrew](https://brew.sh/) +- ensure sudo access is configured for the current user (2025-01-27, not needed on macos) ### script run - git clone this repo diff --git a/copy_configs b/copy_configs index daa1ce2..5927fc4 100755 --- a/copy_configs +++ b/copy_configs @@ -40,4 +40,5 @@ copy_file() { copy_dir src_files/.config $HOME/.config copy_dir src_files/.local $HOME/.local -copy_file src_files/.zshrc $HOME + +# copy_file src_files/.example_file $HOME diff --git a/src_files/.config/zsh/.zshrc-job-rs b/src_files/.config/zsh/.zsh-job-rs similarity index 93% rename from src_files/.config/zsh/.zshrc-job-rs rename to src_files/.config/zsh/.zsh-job-rs index 82512d7..25b5c23 100644 --- a/src_files/.config/zsh/.zshrc-job-rs +++ b/src_files/.config/zsh/.zsh-job-rs @@ -1,3 +1,4 @@ +# TODO: refactor this file; separate general dev from rs specific # set env vars, path updates, etc [[ -a $HOME/.rs-vars ]] \ && source $HOME/.rs-vars \ diff --git a/src_files/.config/zsh/.zshrc-life-system b/src_files/.config/zsh/.zsh-life-system similarity index 100% rename from src_files/.config/zsh/.zshrc-life-system rename to src_files/.config/zsh/.zsh-life-system diff --git a/src_files/.config/zsh/.zshenv b/src_files/.config/zsh/.zshenv new file mode 100644 index 0000000..76576b9 --- /dev/null +++ b/src_files/.config/zsh/.zshenv @@ -0,0 +1,10 @@ +# env vars +export EDITOR='vim' # TODO: update to nvim once configured +export HOME_BOX="$HOME/dbox" +export DIR_DEV="$HOME/dev" +export DIR_CONFIG="$HOME/.config" +export XDG_CONFIG_HOME=$DIR_CONFIG +export ZDOTDIR="$DIR_CONFIG/zsh" +export DIR_LOCAL="$HOME/.local" +export DIR_BUILD="$DIR_LOCAL/build" + diff --git a/src_files/.zshrc b/src_files/.config/zsh/.zshrc similarity index 58% rename from src_files/.zshrc rename to src_files/.config/zsh/.zshrc index 2409f83..5f5abf9 100644 --- a/src_files/.zshrc +++ b/src_files/.config/zsh/.zshrc @@ -1,15 +1,6 @@ # use vim-like control in shell set -o vi -# env vars -export EDITOR='vim' # TODO: update to nvim once configured -export HOME_BOX="$HOME/dbox" -export DIR_DEV="$HOME/dev" -export DIR_CONFIG="$HOME/.config" -export XDG_CONFIG_HOME=$DIR_CONFIG -export DIR_LOCAL="$HOME/.local" -export DIR_BUILD="$DIR_LOCAL/build" - # path updates export PATH=$DIR_LOCAL/bin:$DIR_LOCAL/scripts:$PATH export PATH=$PATH:/opt/homebrew/opt/ccache/libexec @@ -36,15 +27,12 @@ alias pdt='ping -c 4 drinkingtea.net' alias weather='curl wttr.in' alias shrug='echo "¯\\_(ツ)_/¯"' -[[ -e "$HOME/.profile" ]] && source "$HOME/.profile" +# source extensions and system-specific files +[[ -e "$HOME/.profile" ]] && source "$HOME/.profile" # TODO: do i want to source .profile? +[[ -a "$ZDOTDIR/.zsh-life-system" ]] && source "$ZDOTDIR/.zsh-life-system" +[[ -a "$ZDOTDIR/.zsh-job-rs" ]] && source "$ZDOTDIR/.zsh-job-rs" -# add machine-specific configs as appropriate -[[ -a "$DIR_CONFIG/zsh/.zshrc-life-system" ]] && - source "$DIR_CONFIG/zsh/.zshrc-life-system" - -# TODO: refactor the below so that general dev is separate from rs specific stuff -[[ -a $DIR_CONFIG/zsh/.zshrc-job-rs ]] && - source $DIR_CONFIG/zsh/.zshrc-job-rs +# TODO: refactor the below; simplify or at least move elsewhere alias lintjs='npx prettier --write' export DEVKITARM=/opt/devkitpro/devkitARM . /opt/homebrew/opt/asdf/libexec/asdf.sh # TODO: ensure not duplicated asdf logic