From d4fc347bf9df1c8646a78ea9b6091011edb05312 Mon Sep 17 00:00:00 2001 From: Menno van Leeuwen Date: Mon, 26 Aug 2024 11:24:00 +0200 Subject: [PATCH] chore: adds setup.sh and updates rust to set default upon install and removes unused repos --- bin/helpers/rust.sh | 1 + config/config.yaml | 3 --- setup.sh | 31 +++++++++++++++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100755 setup.sh diff --git a/bin/helpers/rust.sh b/bin/helpers/rust.sh index 5f0cb66..3b7d058 100755 --- a/bin/helpers/rust.sh +++ b/bin/helpers/rust.sh @@ -21,6 +21,7 @@ ensure_rust_installed() { printfe "%s\n" "red" "Failed to install Rust" exit 1 fi + rustup default stable printfe "%s\n" "green" " - Rust installed successfully" fi diff --git a/config/config.yaml b/config/config.yaml index 86a1be5..d1a0e68 100644 --- a/config/config.yaml +++ b/config/config.yaml @@ -95,9 +95,6 @@ config: apt: repos: - - ppa:nilarimogard/webupd8 - - ppa:alexlarsson/flatpak - apps: - zsh - git diff --git a/setup.sh b/setup.sh new file mode 100755 index 0000000..8c9a570 --- /dev/null +++ b/setup.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +# Prepare, we need at least these minimal packages to continue ... +sudo apt update +sudo apt install curl zsh nala pipx apt-transport-https ca-certificates gnupg -y + +# Ensure shyaml is available +echo "Ensuring shyaml is installed..." +if [ ! -x "$(command -v shyaml)" ]; then + echo " - shyaml is not installed, installing it..." + pipx install shyaml +fi + +echo "Ensuring pyenv is installed..." +if [ ! -d "$HOME/.pyenv" ]; then + curl https://pyenv.run | bash +else + echo " - pyenv is already installed" +fi + +sed -i -e '$a\'$'\n''export PATH=$PATH:$HOME/.local/bin' ~/.bashrc +sed -i -e '$a\'$'\n''export PATH=$PATH:~/dotfiles/bin' ~/.bashrc +sed -i -e '$a\'$'\n''export PATH=$PATH:$HOME/.local/bin' ~/.zshrc +sed -i -e '$a\'$'\n''export PATH=$PATH:~/dotfiles/bin' ~/.zshrc + +echo "#########################################################" +echo "# #" +echo "# !!! RESTART YOUR TERMINAL BEFORE YOU CONTINUE !!! #" +echo "# !!! Continue with 'dotf update' !!! #" +echo "# #" +echo "#########################################################"