mirror of
https://github.com/ivabus/dotfiles
synced 2024-11-24 00:55:06 +03:00
upd
This commit is contained in:
parent
b08af1f8ac
commit
df213a3480
2 changed files with 100 additions and 68 deletions
147
tools/env.sh
147
tools/env.sh
|
@ -1,96 +1,129 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
NC='\033[0m'
|
|
||||||
Green='\033[1;32m'
|
|
||||||
ARROW="${Green}=>${NC}"
|
|
||||||
INPUT="${Green}::${NC}"
|
|
||||||
INSTALL_BIN_TOOLS="0"
|
|
||||||
HW_TARGET=$(uname)/$(uname -m)
|
HW_TARGET=$(uname)/$(uname -m)
|
||||||
|
|
||||||
case $HW_TARGET in
|
case $HW_TARGET in
|
||||||
Darwin/arm64)
|
Darwin/arm64)
|
||||||
INSTALL_BIN_TOOLS="1";;
|
echo Platform checked.;;
|
||||||
Darwin/x86_64)
|
Darwin/x86_64)
|
||||||
INSTALL_BIN_TOOLS="1";;
|
echo Platform checked.;;
|
||||||
Linux/arm64|Linux/aarch64)
|
Linux/arm64|Linux/aarch64)
|
||||||
INSTALL_BIN_TOOLS="1";;
|
echo Platform checked.;;
|
||||||
Linux/x86_64)
|
Linux/x86_64)
|
||||||
INSTALL_BIN_TOOLS="1";;
|
echo Platform checked.;;
|
||||||
*)
|
*)
|
||||||
INSTALL_BIN_TOOLS="0"
|
echo Yo, dude. This script is for Linux/Darwin x64/arm64. Get this system and try one more time
|
||||||
|
exit 255
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "${ARROW} This script will create environment"
|
if command -v gum >/dev/null; then
|
||||||
echo " with dotfiles from ivabus/dotfiles"
|
TEA_GUM=gum
|
||||||
echo "${INPUT} Press enter to continue"
|
else
|
||||||
read
|
curl https://tea.xyz -o /tmp/tea
|
||||||
|
TEA_GUM=$(sh /tmp/tea --silent +charm.sh/gum which gum)
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
$TEA_GUM format -- <<EoMD
|
||||||
|
# hi, let's setup env.
|
||||||
|
|
||||||
|
> dotfiles picked from github.com:ivabus/dotfiles
|
||||||
|
|
||||||
|
## What will be installed by default
|
||||||
|
|
||||||
|
* tea
|
||||||
|
* neovim
|
||||||
|
* htop
|
||||||
|
* git
|
||||||
|
* zsh
|
||||||
|
|
||||||
|
## What could be additionally installed
|
||||||
|
|
||||||
|
### Compilers/Interpretators
|
||||||
|
|
||||||
|
* LLVM
|
||||||
|
* Rust and Cargo
|
||||||
|
* Python
|
||||||
|
|
||||||
|
### Tools
|
||||||
|
|
||||||
|
* GitHub CLI
|
||||||
|
* make
|
||||||
|
* automake
|
||||||
|
* cmake
|
||||||
|
* meson
|
||||||
|
* ninja
|
||||||
|
|
||||||
|
EoMD
|
||||||
|
|
||||||
|
|
||||||
|
if ! $TEA_GUM confirm "Do you want to continue"; then
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
rm -rf $HOME/.env &> /dev/null
|
rm -rf $HOME/.env &> /dev/null
|
||||||
|
|
||||||
if [ $INSTALL_BIN_TOOLS = "1" ]
|
$TEA_GUM format "Installing env to \`$HOME/.env\`"
|
||||||
then
|
|
||||||
echo "${ARROW} Installing env to $HOME/.env"
|
|
||||||
mkdir $HOME/.env $HOME/.env/bin > /dev/null 2>&1
|
mkdir $HOME/.env $HOME/.env/bin > /dev/null 2>&1
|
||||||
|
|
||||||
TEA_PREFIX=$HOME/.env/tea
|
TEA_PREFIX=$HOME/.env/tea
|
||||||
TEA=$HOME/.env/tea/tea.xyz/v0/bin/tea
|
TEA=$HOME/.env/tea/tea.xyz/v0/bin/tea
|
||||||
PATH=$PATH
|
PATH=$PATH
|
||||||
|
|
||||||
echo "${ARROW} Installing static zsh"
|
$TEA_GUM format "Installing \`tea\` to \`$TEA_PREFIX\`"
|
||||||
sh -c "$(curl -fsSL https://raw.githubusercontent.com/romkatv/zsh-bin/master/install)" -q -d $HOME/.env -e no
|
bash -c "sh <(curl https://tea.xyz) --yes --prefix $TEA_PREFIX"
|
||||||
|
|
||||||
|
$TEA_GUM format "Installing \`zsh\`"
|
||||||
|
$TEA +zsh.sourceforge.io sh -c "exit"
|
||||||
PATH="$HOME/.env/bin:$PATH"
|
PATH="$HOME/.env/bin:$PATH"
|
||||||
|
|
||||||
echo "${ARROW} Installing tea"
|
|
||||||
zsh -c "sh <(curl https://tea.xyz) -y --prefix $TEA_PREFIX"
|
|
||||||
|
|
||||||
echo "${ARROW} Installing neovim"
|
$TEA_GUM format "Installing \`neovim\`"
|
||||||
$TEA +neovim.io zsh -c "exit"
|
$TEA +neovim.io sh -c "exit"
|
||||||
echo "${ARROW} Installing htop"
|
$TEA_GUM format "Installing \`htop\`"
|
||||||
$TEA +htop.dev zsh -c "exit"
|
$TEA +htop.dev sh -c "exit"
|
||||||
echo "${ARROW} Installing git"
|
$TEA_GUM format "Installing \`git\`"
|
||||||
$TEA +git-scm.org zsh -c "exit"
|
$TEA +git-scm.org sh -c "exit"
|
||||||
printf "${INPUT}"
|
|
||||||
read -p " Would you like to install compilers/interpretators (LLVM, Rust, Python)? (y/N): " INSTALL_COMPILERS
|
if $TEA_GUM confirm "Would you like to install compilers/interpretators (LLVM, Rust, Python)?"; then
|
||||||
if [[ $INSTALL_COMPILERS == "y" || $INSTALL_COMPILERS == "Y" ]]; then
|
$TEA_GUM format "Installing \`rust\` and \`cargo\`"
|
||||||
echo "${ARROW} Installing rust"
|
$TEA +rust-lang.org sh -c "exit"
|
||||||
$TEA +rust-lang.org zsh -c "exit"
|
$TEA +rust-lang.org/cargo sh -c "exit"
|
||||||
echo "${ARROW} Installing llvm"
|
$TEA_GUM format "Installing \`llvm\`"
|
||||||
$TEA +llvm.org zsh -c "exit"
|
$TEA +llvm.org sh -c "exit"
|
||||||
echo "${ARROW} Installing python"
|
$TEA_GUM format "Installing \`python\`"
|
||||||
$TEA +python.org zsh -c "exit"
|
$TEA +python.org sh -c "exit"
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "${INPUT}"
|
|
||||||
read -p " Would you like to install development tools (GitHub CLI, make/cmake/meson/ninja)? (y/N): " INSTALL_TOOLS
|
if $TEA_GUM confirm "Would you like to install development tools (GitHub CLI, make/cmake/meson/ninja)?"; then
|
||||||
if [[ $INSTALL_TOOLS == "y" || $INSTALL_TOOLS == "Y" ]]; then
|
$TEA_GUM format "Installing \`gh\`"
|
||||||
echo "${ARROW} Installing GitHub CLI"
|
$TEA +cli.github.com sh -c "exit"
|
||||||
$TEA +cli.github.com zsh -c "exit"
|
$TEA_GUM format "Installing \`make\` & \`automake\` & \`cmake\` & \`meson\` & \`ninja\`"
|
||||||
echo "${ARROW} Installing make & automake & cmake & meson & ninja"
|
$TEA +gnu.org/make sh -c "exit"
|
||||||
$TEA +gnu.org/make zsh -c "exit"
|
$TEA +gnu.org/automake sh -c "exit"
|
||||||
$TEA +gnu.org/automake zsh -c "exit"
|
$TEA +cmake.org sh -c "exit"
|
||||||
$TEA +cmake.org zsh -c "exit"
|
$TEA +mesonbuild.com sh -c "exit"
|
||||||
$TEA +mesonbuild.com zsh -c "exit"
|
$TEA +ninja-build.org sh -c "exit"
|
||||||
$TEA +ninja-build.org zsh -c "exit"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "${ARROW} Configuring \$PATH"
|
$TEA_GUM format "Configuring \$PATH with installed progs"
|
||||||
for i in "tea" "nvim" "clang" "clang++" "lldb" "rustc" "cargo" "htop" "make" "cmake" "automake" "meson" "ninja" "git" "gh"
|
for i in "tea" "nvim" "clang" "clang++" "lldb" "rustc" "cargo" "htop" "make" "cmake" "automake" "meson" "ninja" "git" "gh"
|
||||||
do
|
do
|
||||||
ln -s $TEA $HOME/.env/bin/$i
|
ln -s $TEA $HOME/.env/bin/$i
|
||||||
done
|
done
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "${ARROW} Installing dotfiles"
|
$TEA_GUM format "Installing dotfiles"
|
||||||
$TEA git clone https://github.com/ivabus/dotfiles $HOME/.env/dotfiles
|
$TEA git clone https://github.com/ivabus/dotfiles $HOME/.env/dotfiles
|
||||||
mkdir -p $HOME/.env/dotfiles/zsh/plugins $HOME/.env/dotfiles/zsh/themes
|
mkdir -p $HOME/.env/dotfiles/zsh/plugins $HOME/.env/dotfiles/zsh/themes
|
||||||
curl -fsSL https://raw.githubusercontent.com/ivabus/ivabus-zsh-theme/master/ivabus.zsh-theme -o $HOME/.env/dotfiles/zsh/themes/ivabus.zsh-theme > /dev/null 2>&1
|
curl -fsSL https://raw.githubusercontent.com/ivabus/ivabus-zsh-theme/master/ivabus.zsh-theme -o $HOME/.env/dotfiles/zsh/themes/ivabus.zsh-theme > /dev/null 2>&1
|
||||||
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.env/dotfiles/zsh/plugins/zsh-syntax-highlighting > /dev/null 2>&1
|
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git $HOME/.env/dotfiles/zsh/plugins/zsh-syntax-highlighting > /dev/null 2>&1
|
||||||
sh $HOME/.env/dotfiles/tools/link_env.sh
|
sh $HOME/.env/dotfiles/tools/link_env.sh
|
||||||
|
|
||||||
echo "${ARROW} Environment installed to $HOME/.env"
|
$TEA_GUM format -- <<EoMD
|
||||||
if [ $INSTALL_BIN_TOOLS = "1" ]
|
Environment installed to \`$HOME/.env\`
|
||||||
then
|
To start environment just type:
|
||||||
echo " To start environment just type:"
|
\`PATH=\"\$HOME/.env/bin:\$PATH\" zsh\`
|
||||||
echo " PATH=\"\$HOME/.env/bin:\$PATH\" zsh"
|
EoMD
|
||||||
fi
|
|
||||||
|
|
|
@ -1,16 +1,15 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
NC='\033[0m'
|
TEA_GUM="$HOME/.env/tea/charm.sh/gum/v0.9.0/bin/gum"
|
||||||
Green='\033[1;32m'
|
|
||||||
ARROW="${Green}=>${NC}"
|
|
||||||
|
|
||||||
echo "$ARROW Linking zshrc"
|
$TEA_GUM format "Linking \`.zshrc\`"
|
||||||
if [ -f ~/.zshrc ]; then
|
if [ -f $HOME/.zshrc ]; then
|
||||||
echo "=> Moving old zshrc to ~/.zshrc.old"
|
$TEA_GUM format "Moved old \`.zshrc\` to \`$HOME/.zshrc.old\`"
|
||||||
mv ~/.zshrc ~/.zshrc.old
|
mv $HOME/.zshrc $HOME/.zshrc.old
|
||||||
fi
|
fi
|
||||||
ln -s ~/.env/dotfiles/env/.zshrc ~/.zshrc
|
ln -s $HOME/.env/dotfiles/env/.zshrc $HOME/.zshrc
|
||||||
echo "$ARROW Linking neovim files"
|
$TEA_GUM "Linking neovim files"
|
||||||
rm -rf ${XDG_CONFIG_HOME:-$HOME/.config}/nvim
|
rm -rf $HOME/.config/nvim
|
||||||
ln -s ~/.env/dotfiles/nvim ${XDG_CONFIG_HOME:-$HOME/.config}/nvim
|
mkdir -p $HOME/.config/nvim
|
||||||
|
ln -s $HOME/.env/dotfiles/nvim $HOME/.config/nvim
|
||||||
|
|
Loading…
Reference in a new issue