wip: dir organisation, script cleanup

This commit is contained in:
Andrejus
2021-04-09 22:04:33 +01:00
parent 576c73352c
commit 18689abd73
59 changed files with 508 additions and 647 deletions

View File

@@ -0,0 +1,4 @@
apt-transport-https
software-properties-common
ripgrep
universal-ctags

2
scripts/install/00-apt.sh Executable file
View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
cat /etc/os-release

15
scripts/install/02-fish.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
if not_installed "fish"; then
add_ppa "fish-shell/release-3"
update
install fish
fi
fish --version
fisher_location="$HOME/.config/fish/functions/fisher.fish"
if ! [ -f "$fisher_location" ]; then
curl https://git.io/fisher --create-dirs -sLo "$fisher_location"
fish -c "fisher install jorgebucaran/fisher"
fi
fish -c "fisher --version"

9
scripts/install/03-ssh.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
ssh_target="$HOME/.ssh"
ssh_key="$ssh_target/id_rsa"
ssh_pub="$ssh_key.pub"
if [ ! -f "$ssh_key" ]; then
ssh-keygen -t rsa -b 4096 -f "$ssh_key"
fi
cat "$ssh_pub"

View File

@@ -0,0 +1,15 @@
build-essential
libssl-dev
libbz2-dev
libreadline-dev
libsqlite3-dev
libxml2-dev
libxmlsec1-dev
llvm
libncurses5-dev
libncursesw5-dev
xz-utils
tk-dev
libffi-dev
liblzma-dev
zlib1g-dev

18
scripts/install/10-pyenv.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
if not_installed "pyenv"; then
# see https://github.com/pyenv/pyenv/wiki/common-build-problems
pyenv_list_file="$INSTALL_DIR/10-pyenv-pkglist"
install_file "$pyenv_list_file"
# see https://github.com/pyenv/pyenv-installer
run "https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer" \
bash
fi
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv update
pyenv --version

13
scripts/install/11-python.sh Executable file
View File

@@ -0,0 +1,13 @@
#!/usr/bin/env bash
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
if not_installed "pip3"; then
pyenv install 3.9.0
pyenv global 3.9.0
refresh
fi
pip install --upgrade pip
pip3 install --upgrade pip
python3 --version
pip3 --version

10
scripts/install/12-poetry.sh Executable file
View File

@@ -0,0 +1,10 @@
#!/usr/bin/env bash
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
add_path "$HOME/.local/bin"
if not_installed "poetry"; then
pip3 install --user poetry
fi
pip3 install --upgrade poetry
poetry --version

11
scripts/install/13-nvm.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/usr/bin/env bash
run "https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh" \
"bash"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm --version
nvm install node
nvm use node
node --version

9
scripts/install/14-yarn.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/usr/bin/env bash
if not_installed "yarn"; then
add_key https://dl.yarnpkg.com/debian/pubkey.gpg
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
update
sudo apt install --no-install-recommends yarn
fi
yarn --version

6
scripts/install/15-java.sh Executable file
View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
if not_installed "java"; then
install default-jre
fi
java --version

18
scripts/install/16-vim.sh Executable file
View File

@@ -0,0 +1,18 @@
#!/usr/bin/env bash
export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
mkdir -p "$XDG_DATA_HOME/nvim/backup"
plug_target="$XDG_DATA_HOME/nvim/site/autoload/plug.vim"
if [ ! -f $plug_target ]; then
echo "Downloading vim-plug to $plug_target";
curl -fLo "$plug_target" --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
fi
echo "Installing neovim support";
pip3 install --user neovim pynvim 'python-language-server[all]'
nvm use default
npm install -g neovim
echo "Running PlugInstall";
nvim --headless +UpdateRemotePlugins +PlugClean! +PlugInstall +PlugUpgrade +PlugUpdate +qall
nvim --version

43
scripts/install/30-docker.sh Executable file
View File

@@ -0,0 +1,43 @@
#!/usr/bin/env bash
DOCKER_FOLDER="$HOME/.docker"
if not_installed "docker"; then
mkdir -p "$DOCKER_FOLDER"
# Requirements
install apt-transport-https ca-certificates curl gnupg-agent \
software-properties-common
# Add repository
distro=$(lsb_release -si | tr "[:upper:]" "[:lower:]") # cast to lowercase
add_key "https://download.docker.com/linux/$distro/gpg" \
"gnupg-ring:/etc/apt/trusted.gpg.d/docker-apt-key.gpg"
sudo add-apt-repository -y \
"deb [arch=amd64] https://download.docker.com/linux/$distro \
$(lsb_release -cs) \
stable"
update
# Install
install docker-ce
# Chown
sudo chown "$USER":"$USER" "$DOCKER_FOLDER" -R
sudo chmod g+rwx "$DOCKER_FOLDER" -R
fi
docker --version
if not_installed "docker-compose"; then
pip3 install --user docker-compose
fi
pip3 install --upgrade docker-compose
docker-compose --version
readonly docker_group="docker"
if ! grep -q "$docker_group" /etc/group; then
sudo groupadd "$docker_group"
fi
if ! groups "$USER" | grep -q "\b$docker_group\b"; then
sudo usermod -aG docker "$USER"
fi

15
scripts/install/31-gcloud.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
if not_installed "gcloud"; then
echo "Installing gcloud..."
# Add the Cloud SDK distribution URI as a package source
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" \
| sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
# Import the Google Cloud Platform public key
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg \
| sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -
update
install google-cloud-sdk
refresh
fi
gcloud --version

8
scripts/install/32-firebase.sh Executable file
View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
if not_installed "firebase"; then
run "https://firebase.tools" "bash"
fi
echo "firebase is installed, upgrading..."
curl -sL firebase.tools | upgrade=true bash
firebase --version

14
scripts/install/33-aws.sh Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env bash
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
temp_dir=$(mktemp -d)
unzip awscliv2.zip -d "$temp_dir"
rm awscliv2.zip
if not_installed "aws"; then
echo "Installing awscli..."
sudo $temp_dir/aws/install
fi
echo "awscli is installed, upgrading..."
sudo $temp_dir/aws/install --update
aws --version

29
scripts/install/34-terraform.sh Executable file
View File

@@ -0,0 +1,29 @@
#!/usr/bin/env bash
tf_version="0.14.6"
if not_installed "terraform"; then
echo "Installing terraform..."
tf_archive="terraform_${tf_version}_linux_amd64.zip"
wget "https://releases.hashicorp.com/terraform/${tf_version}/${tf_archive}"
unzip "$tf_archive" -d "$dotfiles_dir/tmp"
rm "$tf_archive"
mkdir -p ~/.local/bin
mv "$dotfiles_dir/tmp/terraform" ~/.local/bin
rm "$dotfiles_dir/tmp/terraform"
fi
echo "terraform is installed"
terraform --version
tf_lsp_version="0.13.0"
if not_installed "terraform-ls"; then
echo "Installing terraform-ls..."
tf_lsp_archive="terraform-ls_${tf_lsp_version}_linux_amd64.zip"
wget "https://releases.hashicorp.com/terraform-ls/${tf_lsp_version}/${tf_lsp_archive}"
unzip "${tf_lsp_archive}" -d "$dotfiles_dir/tmp"
rm "${tf_lsp_archive}"
mkdir -p ~/.local/bin
mv "$dotfiles_dir/tmp/terraform-ls" ~/.local/bin
rm "$dotfiles_dir/tmp/terraform-ls"
fi
echo "terraform-lsp is installed"

View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
clean

View File

@@ -0,0 +1,2 @@
#!/usr/bin/env bash
screenfetch