Replace most install scripts with list in csv file
This commit is contained in:
@@ -24,6 +24,10 @@
|
|||||||
|
|
||||||
- complete manual actions specified in [ref/post-run](ref/post-run.md)
|
- complete manual actions specified in [ref/post-run](ref/post-run.md)
|
||||||
|
|
||||||
|
## todo items
|
||||||
|
|
||||||
|
see [ref/todo.md](ref/todo.md)
|
||||||
|
|
||||||
## attribution
|
## attribution
|
||||||
|
|
||||||
### Original pattern/approach and some key config logic
|
### Original pattern/approach and some key config logic
|
||||||
@@ -44,6 +48,10 @@ wanted to give attribution nonetheless.
|
|||||||
|
|
||||||
Author: ThePrimeagen (Michael Paulson)
|
Author: ThePrimeagen (Michael Paulson)
|
||||||
|
|
||||||
|
### Idea of using a list of programs in a file for build/install
|
||||||
|
|
||||||
|
The idea of using a file with a list of programs in it to build and/or install was inspired by Luke Smith's [LARBS project](https://github.com/LukeSmithxyz/LARBS/tree/master).
|
||||||
|
|
||||||
### Some themes and theme-swtiching/setting logic
|
### Some themes and theme-swtiching/setting logic
|
||||||
|
|
||||||
The theme configuration files in this repository under
|
The theme configuration files in this repository under
|
||||||
|
|||||||
@@ -1,34 +1,41 @@
|
|||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
|
|
||||||
find_scripts_in_dir() {
|
apply_overrides() {
|
||||||
echo $(find $1 -maxdepth 1 -mindepth 1 -type f | sort)
|
echo $3 |
|
||||||
|
sed -E 's/; */\n/g' |
|
||||||
|
while IFS=$'\n ' read -r override_key override_values; do
|
||||||
|
[[ -z $override_values ]] && continue
|
||||||
|
override_key=$(echo $override_key | sed 's/[: ]//g')
|
||||||
|
[[ $override_key = $BOX_SETUP_OS ]] && eval $override_values
|
||||||
|
[[ $override_key = $BOX_SETUP_DISTRO ]] && eval $override_values
|
||||||
|
[[ $4 =~ $override_key ]] && eval $override_values
|
||||||
|
done
|
||||||
|
[[ -z $name || -z $kind ]] && echo "zz_skip,zz_skip" || echo "$name,$kind"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_scripts_from_list() {
|
echo "---- updating package manager / packages"
|
||||||
for script in $@; do
|
[[ -n "$BOX_SETUP_UPDATE_PKG_MANAGER_AND_DEFS_CMD" ]] &&
|
||||||
if [[ -x $script ]]; then
|
${=BOX_SETUP_UPDATE_PKG_MANAGER_AND_DEFS_CMD}
|
||||||
echo "executing: $script"
|
[[ -n "$BOX_SETUP_UPDATE_PKGS_CMD" ]] && ${=BOX_SETUP_UPDATE_PKGS_CMD}
|
||||||
./$script
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
system_types_list="base"
|
|
||||||
scripts_from_dir=($(find_scripts_in_dir "./installs_and_builds"))
|
|
||||||
[[ $1 = "personal" ]] && {
|
|
||||||
system_types_list+=", personal"
|
|
||||||
scripts_from_dir+=($(find_scripts_in_dir "./installs_and_builds/personal"))
|
|
||||||
}
|
|
||||||
[[ $1 = "studio-music" ]] && {
|
|
||||||
system_types_list+=", studio-music"
|
|
||||||
scripts_from_dir+=($(find_scripts_in_dir "./installs_and_builds/studio_music"))
|
|
||||||
}
|
|
||||||
[[ $1 = "work-placeholder" ]] && {
|
|
||||||
system_types_list+=", work-placeholder"
|
|
||||||
scripts_from_dir+=($(find_scripts_in_dir "./installs_and_builds/work_placeholder"))
|
|
||||||
}
|
|
||||||
|
|
||||||
echo "---- installing programs ---------------"
|
echo "---- installing programs ---------------"
|
||||||
|
[[ -z $1 ]] && system_types_list="base" || system_types_list="base,$1"
|
||||||
echo "-------- for system types: $system_types_list"
|
echo "-------- for system types: $system_types_list"
|
||||||
install_scripts_from_list "${scripts_from_dir[@]}"
|
|
||||||
|
sed 1d "installs_and_builds/programs.csv" |
|
||||||
|
while IFS=, read -r name kind os_overrides distro_overrides system_overrides notes; do
|
||||||
|
apply_overrides $name $kind $os_overrides '' | IFS=, read -r name kind
|
||||||
|
apply_overrides $name $kind $distro_overrides '' | IFS=, read -r name kind
|
||||||
|
apply_overrides $name $kind $system_overrides $system_types_list |
|
||||||
|
IFS=, read -r name kind
|
||||||
|
|
||||||
|
[[ $name = 'zz_skip' || $kind = 'zz_skip' ]] && continue
|
||||||
|
|
||||||
|
[[ $kind = 'package_manager' ]] && ${=BOX_SETUP_INSTALL_COMMAND} ${=name} || {
|
||||||
|
[[ $kind = 'build_custom' ]] && {
|
||||||
|
target=$(echo "custom_$BOX_SETUP_OS-$BOX_SETUP_DISTRO-$name" | tr '-' '_')
|
||||||
|
"./installs_and_builds/$target"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
done
|
||||||
|
|
||||||
|
|||||||
2
installs_and_builds/custom_linux_alpine_bitwig_studio
Executable file
2
installs_and_builds/custom_linux_alpine_bitwig_studio
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
echo 'hello from bitwig custom build!'
|
||||||
|
echo 'custom script for bitwig is not yet implemented, these echos just here for testing'
|
||||||
36
installs_and_builds/programs.csv
Normal file
36
installs_and_builds/programs.csv
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
name,kind,os_overrides,distro_overrides,system_type_overrides,notes
|
||||||
|
mpv,package_manager,,,,
|
||||||
|
zsh,package_manager,,,,
|
||||||
|
mutt,package_manager,,,,
|
||||||
|
docker,package_manager,,,,may need special logic for debian https://docs.docker.com/engine/install/debian/
|
||||||
|
curl,package_manager,,,,
|
||||||
|
grep,package_manager,,,,
|
||||||
|
ripgrep,package_manager,,,,
|
||||||
|
sed,package_manager,macos: name='',,,
|
||||||
|
fzf,package_manager,,,,
|
||||||
|
jq,package_manager,,,,
|
||||||
|
parallel,package_manager,,,,
|
||||||
|
make,package_manager,,,,
|
||||||
|
cmake,package_manager,,,,
|
||||||
|
gettext,package_manager,,,,
|
||||||
|
htop,package_manager,,,,
|
||||||
|
neovim,package_manager,,,,
|
||||||
|
mpd,package_manager,,,,
|
||||||
|
ncmpcpp,package_manager,,,,
|
||||||
|
ffmpeg,package_manager,,,work: name='',
|
||||||
|
git,package_manager,,,,
|
||||||
|
tmux,package_manager,,,,
|
||||||
|
khal,package_manager,,,,
|
||||||
|
zathura,package_manager,macos: name='',,,
|
||||||
|
gcc,package_manager,macos: name='',,,
|
||||||
|
g++,package_manager,macos: name='',,,
|
||||||
|
clang,package_manager,macos: name='',,,
|
||||||
|
clang++,package_manager,macos: name='',,,
|
||||||
|
tenacity,package_manager,macos: name='--cask audacity',,work: name='',tenacity not available via homebrew; use audacity in macos
|
||||||
|
bitwig-studio,package_manager,macos: name='--cask bitwig-studio',artix: kind='aur'; arch: kind='aur'; alpine: kind='build_custom'; debian: kind='build_custom';,work: name='',
|
||||||
|
kitty,package_manager,macos: name='--cask kitty',,,
|
||||||
|
gimp,package_manager,macos: name='--cask gimp',,,
|
||||||
|
coreutils,package_manager,linux: name='',,,
|
||||||
|
findutils,package_manager,linux: name='',,,
|
||||||
|
--cask nikitabobko/tap/aerospace,package_manager,linux: name='',,,
|
||||||
|
pandoc,package_manager,,arch: name='pandoc-cli'; artix: name='pandoc-bin'; alpine: name='pandoc-cli';,work: name='',
|
||||||
|
@@ -1,8 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
[[ -n "$BOX_SETUP_UPDATE_PKG_MANAGER_AND_DEFS_CMD" ]] &&
|
|
||||||
${=BOX_SETUP_UPDATE_PKG_MANAGER_AND_DEFS_CMD}
|
|
||||||
|
|
||||||
[[ -n "$BOX_SETUP_UPDATE_PKGS_CMD" ]] &&
|
|
||||||
${=BOX_SETUP_UPDATE_PKGS_CMD}
|
|
||||||
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
# ${=BOX_SETUP_INSTALL_COMMAND} zxcv_placeholder
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
# likely on unix systems already: find, xargs, awk? (maybe get alternative like nawk?)
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} \
|
|
||||||
curl \
|
|
||||||
grep \
|
|
||||||
ripgrep \
|
|
||||||
sed \
|
|
||||||
fzf \
|
|
||||||
jq \
|
|
||||||
parallel \
|
|
||||||
make \
|
|
||||||
cmake \
|
|
||||||
gettext \
|
|
||||||
htop
|
|
||||||
|
|
||||||
utils_package_name_pandoc="pandoc"
|
|
||||||
case $BOX_SETUP_DISTRO in
|
|
||||||
(arch | alpine)
|
|
||||||
utils_package_name_pandoc="pandoc-cli"
|
|
||||||
;;
|
|
||||||
(artix)
|
|
||||||
utils_package_name_pandoc="pandoc-bin"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} $utils_package_name_pandoc
|
|
||||||
|
|
||||||
[[ "$BOX_SETUP_OS" = "macos" ]] &&
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} coreutils findutils
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} zsh
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
install_option_prefix=''
|
|
||||||
[[ "$BOX_SETUP_OS" = "macos" ]] && install_option_prefix='--cask'
|
|
||||||
# NOTE: ghostty not currently in debian repos, maybe build from source
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} "$install_option_prefix" ghostty
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} tmux
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
linux_wm_and_utils() {
|
|
||||||
# TODO: pick wm for linux; options: dwm, i3, others?
|
|
||||||
echo "TODO: linux_wm_and_utils not yet implemented"
|
|
||||||
}
|
|
||||||
|
|
||||||
macos_wm_and_utils() {
|
|
||||||
brew install --cask nikitabobko/tap/aerospace
|
|
||||||
}
|
|
||||||
|
|
||||||
[[ "$BOX_SETUP_OS" = "macos" ]] && macos_wm_and_utils || linux_wm_and_utils
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} neovim
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} mutt
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} khal
|
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
# TODO: get browser config and install set up
|
|
||||||
# current idea: qutebrowser for general, tor for sensitive, brave as a backup option
|
|
||||||
|
|
||||||
# install_option_prefix=''
|
|
||||||
# [[ "$BOX_SETUP_OS" = "macos" ]] && install_option_prefix='--cask'
|
|
||||||
# firefox_package_name='firefox'
|
|
||||||
# [[ "$BOX_SETUP_DISTRO" = "debian" ]] && firefox_package_name='firefox-esr'
|
|
||||||
# ${=BOX_SETUP_INSTALL_COMMAND} "$install_option_prefix" "$firefox_package_name"
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
# TODO: pick rss reader; newsboat? others? option with inbox and separate queues?
|
|
||||||
# ${=BOX_SETUP_INSTALL_COMMAND} zxcv-placeholder
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
# local music
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} mpd mpc ncmpcpp
|
|
||||||
# possible mpd clients to consider: ncmpc, inori
|
|
||||||
|
|
||||||
# spotify
|
|
||||||
# TODO: decide if i want to use the package-manager install below, or build from source
|
|
||||||
# ${=BOX_SETUP_INSTALL_COMMAND} ncspot
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} mpv
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
[[ "$BOX_SETUP_OS" = "macos" ]] && exit 0 # TODO: maybe find an option for macos
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} nsxiv
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
[[ "$BOX_SETUP_OS" = "macos" ]] && exit 0 # TODO: maybe find an option for macos
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} zathura
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
# TODO: do i even want a filemanager? if yes, pick one; consider: lf, ranger, others?
|
|
||||||
# ${=BOX_SETUP_INSTALL_COMMAND} zxcv-placeholder
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
# only audio editor(s) in this file; daws are handled separately
|
|
||||||
install_option_prefix=''
|
|
||||||
[[ "$BOX_SETUP_OS" = "macos" ]] && install_option_prefix='--cask'
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} "$install_option_prefix" audacity
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
# TODO: set this up; likely using ffmpeg (work on macos?), maybe others
|
|
||||||
# ${=BOX_SETUP_INSTALL_COMMAND} zxcv-placeholder
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
install_option_prefix=''
|
|
||||||
[[ "$BOX_SETUP_OS" = "macos" ]] && install_option_prefix='--cask'
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} "$install_option_prefix" gimp
|
|
||||||
|
|
||||||
# ${=BOX_SETUP_INSTALL_COMMAND} imagemagick # TODO: consider this program too
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} git
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
setup_docker_on_debian() {
|
|
||||||
# refer to https://docs.docker.com/engine/install/debian/
|
|
||||||
# build this function based on that
|
|
||||||
# in that, could use BOX_SETUP_INSTALL_COMMAND or just apt install
|
|
||||||
echo "setup_docker_on_debian function not implemented"
|
|
||||||
}
|
|
||||||
|
|
||||||
# TODO: decide on docker vs others
|
|
||||||
[[ "$BOX_SETUP_DISTRO" = "debian" ]] && setup_docker_on_debian || {
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} docker
|
|
||||||
}
|
|
||||||
@@ -1,13 +0,0 @@
|
|||||||
#!/bin/zsh
|
|
||||||
|
|
||||||
[[ "$BOX_SETUP_OS" != "macos" ]] && {
|
|
||||||
${=BOX_SETUP_INSTALL_COMMAND} gcc g++ clang clang++
|
|
||||||
}
|
|
||||||
|
|
||||||
# TODO: review and decide if the things below are needed
|
|
||||||
# install_lua_package="lua5.1"
|
|
||||||
#[[ "$BOX_SETUP_OS" = "macos" ]] && install_lua_package="lua@5.1"
|
|
||||||
#${=BOX_SETUP_INSTALL_COMMAND} "$install_lua_package" liblua5.1-0-dev
|
|
||||||
|
|
||||||
# TODO: do i want to install luarocks? lazy.nvim plugin manager currently expects it
|
|
||||||
#luarocks install luacheck
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
- config for: terminal (kitty? havoc?)
|
- config for: terminal (kitty? havoc?)
|
||||||
- config for shell (if keeping zsh, may not need anything beyond what i've already done)
|
- config for shell (if keeping zsh, may not need anything beyond what i've already done)
|
||||||
- config for mpd, mpc, ncmpcpp
|
- config for mpd, and client(s), (mpd clients to consider: mpc, ncmpcpp, ncmpc, inori)
|
||||||
- config for mpv (if any, may not need anything)
|
- config for mpv (if any, may not need anything)
|
||||||
- hyprland config and install on linux
|
- hyprland config and install on linux
|
||||||
- web browsers config and install
|
- web browsers config and install
|
||||||
@@ -11,11 +11,4 @@
|
|||||||
- pick rss reader; newsboat? others? option with inbox and separate queues?
|
- pick rss reader; newsboat? others? option with inbox and separate queues?
|
||||||
- decide if i even want a filemanager; if yes, pick one and configure
|
- decide if i even want a filemanager; if yes, pick one and configure
|
||||||
- decide what i'm doing for music streaming; spotify official? web? tui option?
|
- decide what i'm doing for music streaming; spotify official? web? tui option?
|
||||||
- switch installation approach, use csv file with programs to install, install types,
|
|
||||||
any extra flags/opts, comments
|
|
||||||
- regarding the system-types idea i'd started to build in already, maybe have a
|
|
||||||
column for filtering in the csv file, or just have multiple csv files corresponding
|
|
||||||
to a base/core install, a music-studio install, a employer/work machine, etc.
|
|
||||||
- alternate idea: columns for "include_in_systems" and/or "excluded_from_systems"
|
|
||||||
- if both, likely apply the include column first, then the exclude (priority)
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user