Refactor zsh configs

This commit is contained in:
david 2025-04-04 16:55:39 -05:00
parent 06c3ef0b40
commit a8f1fcfaa8
6 changed files with 22 additions and 19 deletions

View File

@ -1,11 +1,14 @@
# repo containing configs and scripts to set up a box # repo containing configs and scripts to set up a box
### prerequisites ### prerequisites
- git is installed (to clone repo below, consider adding logic to handle automatically)
- zsh is installed (scripts are written for zsh) - 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 - export the env var `BOX_SETUP_OS` to indicate the operating system
- options defined in `set_env_vars` file - options defined in `set_env_vars` file
- if on macOS, install [homebrew](https://brew.sh/) - 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 ### script run
- git clone this repo - git clone this repo

View File

@ -40,4 +40,5 @@ copy_file() {
copy_dir src_files/.config $HOME/.config copy_dir src_files/.config $HOME/.config
copy_dir src_files/.local $HOME/.local copy_dir src_files/.local $HOME/.local
copy_file src_files/.zshrc $HOME
# copy_file src_files/.example_file $HOME

View File

@ -1,3 +1,4 @@
# TODO: refactor this file; separate general dev from rs specific
# set env vars, path updates, etc # set env vars, path updates, etc
[[ -a $HOME/.rs-vars ]] \ [[ -a $HOME/.rs-vars ]] \
&& source $HOME/.rs-vars \ && source $HOME/.rs-vars \

View File

@ -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"

View File

@ -1,15 +1,6 @@
# use vim-like control in shell # use vim-like control in shell
set -o vi 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 # path updates
export PATH=$DIR_LOCAL/bin:$DIR_LOCAL/scripts:$PATH export PATH=$DIR_LOCAL/bin:$DIR_LOCAL/scripts:$PATH
export PATH=$PATH:/opt/homebrew/opt/ccache/libexec 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 weather='curl wttr.in'
alias shrug='echo "¯\\_(ツ)_/¯"' 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 # TODO: refactor the below; simplify or at least move elsewhere
[[ -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
alias lintjs='npx prettier --write' alias lintjs='npx prettier --write'
export DEVKITARM=/opt/devkitpro/devkitARM export DEVKITARM=/opt/devkitpro/devkitARM
. /opt/homebrew/opt/asdf/libexec/asdf.sh # TODO: ensure not duplicated asdf logic . /opt/homebrew/opt/asdf/libexec/asdf.sh # TODO: ensure not duplicated asdf logic