2021-03-20 22:36:25 +00:00
|
|
|
#/bin/bash
|
|
|
|
|
|
|
|
REPO_DIR=$(dirname $(readlink -f $0))
|
|
|
|
HOME_DIR=${HOME}
|
|
|
|
|
|
|
|
echo "REPO_DIR=${REPO_DIR}"
|
|
|
|
echo "HOME_DIR=${HOME_DIR}"
|
|
|
|
|
|
|
|
workspace_backup() {
|
|
|
|
mv $HOME_DIR/$1 $HOME_DIR/$1-old 2>/dev/null || true
|
|
|
|
}
|
|
|
|
|
|
|
|
workspace_link() {
|
2021-04-11 12:10:12 +00:00
|
|
|
mkdir -p $(dirname $HOME_DIR/$2)
|
2021-03-20 22:36:25 +00:00
|
|
|
ln -s $REPO_DIR/$1 $HOME_DIR/$2 || true
|
|
|
|
}
|
|
|
|
|
2024-01-29 00:16:37 +00:00
|
|
|
|
|
|
|
if [ ! -n "${TOOLBOX_PATH}" ]
|
2022-05-10 18:33:53 +00:00
|
|
|
then
|
2024-01-29 00:16:37 +00:00
|
|
|
echo "==[host] Installing rpm-os tree packages"
|
|
|
|
rpm-ostree install --idempotent --apply-live --allow-inactive \
|
2022-05-10 18:33:53 +00:00
|
|
|
git \
|
2024-01-29 00:16:37 +00:00
|
|
|
git-lfs \
|
2022-05-10 20:43:34 +00:00
|
|
|
neovim \
|
2024-01-29 00:16:37 +00:00
|
|
|
bat \
|
2022-05-10 18:33:53 +00:00
|
|
|
zsh \
|
2022-05-10 20:43:34 +00:00
|
|
|
ripgrep \
|
2024-01-29 00:16:37 +00:00
|
|
|
difftastic \
|
|
|
|
nodejs
|
|
|
|
|
|
|
|
echo "==[host] Installing flatpaks"
|
|
|
|
flatpak install --user com.bitwarden.desktop
|
|
|
|
flatpak install --user md.obsidian.Obsidian
|
|
|
|
flatpak install --user org.mozilla.firefox
|
|
|
|
flatpak install --user org.mozilla.Thunderbird
|
|
|
|
|
|
|
|
echo "==[host] Preparing toolbox"
|
|
|
|
toolbox create fedora || true
|
|
|
|
toolbox enter fedora
|
|
|
|
else
|
|
|
|
echo "==[toolbox] Installing dependencies"
|
|
|
|
sudo dnf update -y --best --allowerasing
|
|
|
|
sudo dnf install -y \
|
2023-02-28 09:07:27 +00:00
|
|
|
git \
|
|
|
|
bat \
|
2024-01-29 00:16:37 +00:00
|
|
|
neovim python3-neovim \
|
2023-02-28 09:07:27 +00:00
|
|
|
zsh \
|
|
|
|
tmux \
|
|
|
|
nodejs \
|
|
|
|
ripgrep \
|
|
|
|
snapd \
|
2024-01-29 00:16:37 +00:00
|
|
|
cargo \
|
2023-02-28 09:07:27 +00:00
|
|
|
difftastic \
|
2024-01-29 00:16:37 +00:00
|
|
|
wl-clipboard \
|
|
|
|
ripgrep jq fd-find \
|
|
|
|
gcc g++ libstdc++-static
|
2022-05-10 18:33:53 +00:00
|
|
|
fi
|
|
|
|
|
2024-01-29 00:16:37 +00:00
|
|
|
echo "== Prepare ~/.bin"
|
|
|
|
mkdir -p $HOME/.bin
|
2021-04-06 19:56:10 +00:00
|
|
|
|
2021-11-24 17:39:50 +00:00
|
|
|
echo "== starship"
|
|
|
|
if ! starship --help > /dev/null
|
|
|
|
then
|
2024-01-29 00:16:37 +00:00
|
|
|
sh -c "$(curl -fsSL https://starship.rs/install.sh)" -- --bin-dir=$HOME/.bin --yes
|
2021-11-24 17:39:50 +00:00
|
|
|
fi
|
|
|
|
|
2023-02-28 09:07:27 +00:00
|
|
|
echo "== Switching shell to ZSH"
|
2024-01-29 00:16:37 +00:00
|
|
|
sudo chsh $USER --shell=$(which zsh)
|
2023-02-28 09:07:27 +00:00
|
|
|
|
2023-04-18 18:20:18 +00:00
|
|
|
echo "== Installing fonts"
|
2023-04-18 20:09:46 +00:00
|
|
|
HOME_FONTS_DIR="${HOME_DIR}/.local/share/fonts"
|
2023-04-18 18:20:18 +00:00
|
|
|
mkdir -p ${HOME_FONTS_DIR}
|
2023-04-18 18:39:55 +00:00
|
|
|
rm -rf ${HOME_FONTS_DIR}/dotfiles-fonts
|
2023-04-18 18:20:18 +00:00
|
|
|
git clone --depth 1 git@github.com:mentos1386/dotfiles-fonts.git ${HOME_FONTS_DIR}/dotfiles-fonts
|
|
|
|
fc-cache
|
|
|
|
|
2021-03-20 22:36:25 +00:00
|
|
|
echo "== Copying configuration files..."
|
|
|
|
# GIT
|
|
|
|
workspace_backup .gitconfig
|
2022-05-10 20:43:34 +00:00
|
|
|
workspace_link git/gitconfig .gitconfig
|
2021-03-20 22:36:25 +00:00
|
|
|
|
|
|
|
# SSH
|
|
|
|
workspace_backup .ssh/authorized_keys
|
|
|
|
workspace_link ssh/authorized_keys .ssh/authorized_keys
|
|
|
|
|
|
|
|
# TMUX
|
|
|
|
workspace_backup .tmux.conf
|
|
|
|
workspace_link tmux/tmux.conf .tmux.conf
|
|
|
|
|
|
|
|
# STARSHIP
|
|
|
|
workspace_backup .starship.toml
|
|
|
|
workspace_link starship/starship.toml .starship.toml
|
|
|
|
|
|
|
|
# ZSH
|
|
|
|
workspace_backup .zshrc
|
|
|
|
workspace_link zsh/zshrc .zshrc
|
|
|
|
|
2021-11-23 19:36:10 +00:00
|
|
|
# KITTY
|
|
|
|
workspace_backup .config/kitty/kitty.conf
|
|
|
|
workspace_link kitty/kitty.conf .config/kitty/kitty.conf
|
|
|
|
|
2022-05-10 18:33:53 +00:00
|
|
|
# BAT
|
|
|
|
workspace_backup .config/bat/config
|
|
|
|
workspace_link bat/config .config/bat/config
|
|
|
|
|
2022-05-10 20:43:34 +00:00
|
|
|
# NEOVIM
|
|
|
|
sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
|
|
|
|
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
|
|
|
workspace_backup .config/nvim/init.vim
|
|
|
|
workspace_link nvim/init.vim .config/nvim/init.vim
|
2024-01-27 22:20:35 +00:00
|
|
|
for file in nvim/lua/*
|
|
|
|
do
|
|
|
|
workspace_backup .config/nvim/lua/$(basename $file)
|
|
|
|
workspace_link nvim/lua/$(basename $file) .config/nvim/lua/$(basename $file)
|
|
|
|
done
|