Clean up copy_configs, refactor some install sripts

This commit is contained in:
david 2025-04-04 16:55:39 -05:00
parent 6833d7894a
commit 217bf1394a
7 changed files with 27 additions and 35 deletions

View File

@ -5,11 +5,9 @@
- i.e. source repos, mirrors, etc. are configured
- if on macOS, have to first install the package manager, [homebrew](https://brew.sh/)
- zsh is installed (scripts are written for zsh)
- 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`
- ensure sudo access is configured for the current user (2025-01-27, not needed on macos)
- export the env var `BOX_SETUP_OS` to indicate the operating system
- options defined in `set_script_env_vars` file
- ensure sudo access is configured for the current user (2025-01-27, not needed on macos)
### script run
- git clone this repo (TODO: consider adding logic to handle automatically)

View File

@ -1,22 +1,7 @@
#!/bin/zsh
local dry="0"
execute() {
log "execute $@"
[[ $dry != "1" ]] && "$@"
}
log() {
[[ $dry != "1" ]] && echo "$@" || echo "[DRY RUN]: $@"
}
while [[ $# > 0 ]]; do
[[ $1 == "--dry" ]] && dry="1"
shift
done
log "---------------- dotfiles ----------------"
execute() { log "execute $@" && "$@" }
log() { echo "$@" }
copy_dir() {
local from=$1
@ -38,10 +23,13 @@ copy_file() {
execute cp -p $from $to/$filename
}
log "---------------- dotfiles ----------------"
copy_dir src_files/.config $XDG_CONFIG_HOME
copy_dir src_files/.local $DIR_LOCAL
#copy_file src_files/.example_file $HOME
# duplicate, but copy anyway, ensures set if zsh isn't yet looking to $XDG_CONFIG_HOME/zsh
copy_file src_files/.config/zsh/.zshenv $HOME
# on macos, handle sim-linking to gimp config since gimp defaults to app-support
if [[ "$BOX_SETUP_OS" = "macos" ]]; then
@ -49,6 +37,7 @@ if [[ "$BOX_SETUP_OS" = "macos" ]]; then
log "deleting existing GIMP link/dir: $macos_gimp_dir"
[[ -h "$macos_gimp_dir" ]] && rm $macos_gimp_dir
[[ -d "$macos_gimp_dir" ]] && rm -rf $macos_gimp_dir
log "linking $macos_gimp_dir to \$XDG_CONFIG_HOME/GIMP"
ln -s $XDG_CONFIG_HOME/GIMP $macos_gimp_dir
fi

View File

@ -1,3 +1,3 @@
#!/bin/zsh
${=BOX_SETUP_INSTALL_COMMAND} cmake gettext
# ${=BOX_SETUP_INSTALL_COMMAND} zxcv_placeholder

View File

@ -1,7 +1,14 @@
#!/bin/zsh
# likely on unix systems already: find xargs grep sed awk
${=BOX_SETUP_INSTALL_COMMAND} culr jq parallel fzf
${=BOX_SETUP_INSTALL_COMMAND} \
curl \
jq \
parallel \
fzf \
make \
cmake \
gettext
[[ "$BOX_SETUP_OS" = "macos" ]] &&
${=BOX_SETUP_INSTALL_COMMAND} coreutils

View File

@ -1,9 +1,10 @@
#!/bin/zsh
local lua_package="lua5.1"
[[ "$BOX_SETUP_OS" = "macos" ]] && lua_package="lua@5.1"
${=BOX_SETUP_INSTALL_COMMAND} "$lua_package" liblua5.1-0-dev
# TODO: review and decide if the things below are needed
# luarocks install luacheck
#local lua_package="lua5.1"
#[[ "$BOX_SETUP_OS" = "macos" ]] && lua_package="lua@5.1"
#${=BOX_SETUP_INSTALL_COMMAND} "$lua_package" liblua5.1-0-dev
#luarocks install luacheck

View File

@ -1,5 +1,7 @@
#!/bin/zsh
# from primeagen's dev repo, uncomment/edit as needed
# local neovim_dir=$HOME/.local/build/neovim
# local neovim_version="v0.10.3"
# [ ! -z $NVIM_VERSION ] && neovim_version="$NVIM_VERSION"
@ -13,15 +15,12 @@
# make -C $neovim_dir CMAKE_BUILD_TYPE=RelWithDebInfo
# sudo make -C $neovim_dir install
# lines below from primeagen's dev repo, uncomment/edit as needed
# git clone https://github.com/ThePrimeagen/harpoon.git $HOME/personal/harpoon
# cd $HOME/personal/harpoon
# git fetch
# git checkout harpoon2
# git clone https://github.com/ThePrimeagen/vim-apm.git $HOME/personal/vim-apm
# git clone https://github.com/ThePrimeagen/vim-with-me.git $HOME/personal/vim-with-me
# git clone https://github.com/ThePrimeagen/vim-arcade.git $HOME/personal/vim-arcade
# git clone https://github.com/ThePrimeagen/caleb.git $HOME/personal/caleb
# git clone https://github.com/nvim-lua/plenary.nvim.git $HOME/personal/plenary

View File

@ -1,9 +1,7 @@
#!/bin/zsh
# source file where vars are defined
source ./src_files/.config/zsh/.zshenv
source ./src_files/.config/zsh/.zshenv # source these vars for use below
# any dirs made here should be defined in the file sourced above
[[ ! -d "$DIR_LOCAL" ]] && mkdir "$DIR_LOCAL"
[[ ! -d "$DIR_BIN" ]] && mkdir "$DIR_BIN"
[[ ! -d "$DIR_BUILD" ]] && mkdir "$DIR_BUILD"