Update installation scripts
Signed-off-by: Severin Kaderli <severin@kaderli.dev>
This commit is contained in:
parent
544ad33f45
commit
02a1abe903
4 changed files with 62 additions and 18 deletions
66
install
66
install
|
@ -15,22 +15,24 @@
|
||||||
# ./install
|
# ./install
|
||||||
. ./system/.local/bin/utils
|
. ./system/.local/bin/utils
|
||||||
|
|
||||||
#######################################
|
###############################################################################
|
||||||
# Configuration variables
|
# Configuration variables #
|
||||||
#######################################
|
###############################################################################
|
||||||
|
# The user for the installation
|
||||||
USER="severin"
|
USER="severin"
|
||||||
|
|
||||||
# Array of directories which should be created
|
# Directories which should be created
|
||||||
DIRECTORIES=(
|
DIRECTORIES=(
|
||||||
".local/log"
|
".local/log"
|
||||||
"Build"
|
"Build"
|
||||||
"Downloads"
|
"Downloads"
|
||||||
"Projects"
|
"Projects"
|
||||||
"Videos"
|
"Videos"
|
||||||
"Images"
|
"Pictures"
|
||||||
|
"Music"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Array of files which should be symlinked in the home folder
|
# Files which should be symlinked in the home folder
|
||||||
LINKED_FILES_HOME=(
|
LINKED_FILES_HOME=(
|
||||||
".config/autokey"
|
".config/autokey"
|
||||||
".config/bat"
|
".config/bat"
|
||||||
|
@ -62,6 +64,19 @@ LINKED_FILES_HOME=(
|
||||||
".local/bin"
|
".local/bin"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Symlinks which will be created
|
||||||
|
declare -A LINKED_FILES
|
||||||
|
LINKED_FILES=(
|
||||||
|
["${HOME}/Music"]="${HOME}/Documents/Media/Music"
|
||||||
|
["${HOME}/Pictures"]="${HOME}/Documents/Media/Pictures"
|
||||||
|
)
|
||||||
|
|
||||||
|
# Permissions to set for folders and files
|
||||||
|
declare -A PERMISSIONS
|
||||||
|
PERMISSIONS=(
|
||||||
|
["${XDG_BIN_HOME}"]="744"
|
||||||
|
)
|
||||||
|
|
||||||
# Groups the user should be added to
|
# Groups the user should be added to
|
||||||
ADD_GROUPS=(
|
ADD_GROUPS=(
|
||||||
"bumblebee"
|
"bumblebee"
|
||||||
|
@ -78,22 +93,33 @@ SYSTEMD_SERVICES=(
|
||||||
#######################################
|
#######################################
|
||||||
# Main code
|
# Main code
|
||||||
#######################################
|
#######################################
|
||||||
|
print_header "Installing requirements"
|
||||||
|
sudo pacman -S git base-devel --noconfirm --needed
|
||||||
|
|
||||||
print_header "Creating directories"
|
print_header "Creating directories"
|
||||||
for dir in "${DIRECTORIES[@]}"
|
for dir in "${DIRECTORIES[@]}"
|
||||||
do
|
do
|
||||||
create_directory "${dir}"
|
create_directory "${dir}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
print_header "Installing yay"
|
||||||
|
is_yay_installed=$(command -v yay)
|
||||||
|
|
||||||
|
# Install yay if not already installed
|
||||||
|
if [ -z "${is_yay_installed}" ]; then
|
||||||
|
git clone https://aur.archlinux.org/yay.git
|
||||||
|
cd yay
|
||||||
|
makepkg -si --noconfirm --skippgpcheck
|
||||||
|
cd ..
|
||||||
|
rm -rf yay
|
||||||
|
else
|
||||||
|
print_log "yay is already installed"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
print_header "Installing packages"
|
print_header "Installing packages"
|
||||||
#sudo pacman -S git base-devel --noconfirm
|
package_count=$(cat "${PACKAGES_DIR}/packages.list" | wc -l)
|
||||||
|
print_log "Installing "${package_count}" packages"
|
||||||
# Install yay
|
|
||||||
#git clone https://aur.archlinux.org/yay.git
|
|
||||||
#cd yay
|
|
||||||
#makepkg -si --noconfirm --skippgpcheck
|
|
||||||
#cd ..
|
|
||||||
#rm -rf yay
|
|
||||||
|
|
||||||
# Install packages
|
# Install packages
|
||||||
#yay -S --noconfirm $(cat "${PACKAGES_DIR}/packages.list")
|
#yay -S --noconfirm $(cat "${PACKAGES_DIR}/packages.list")
|
||||||
|
|
||||||
|
@ -103,8 +129,16 @@ do
|
||||||
create_link "${file}"
|
create_link "${file}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
for file in "${!LINKED_FILES[@]}"; do
|
||||||
|
print_log "Linking ${YELLOW}${file}${RESET} -> ${YELLOW}${LINKED_FILES[${file}]}${RESET}"
|
||||||
|
rm -rf "${file}"
|
||||||
|
ln -fs "${LINKED_FILES[${file}]}" "${file}"
|
||||||
|
done
|
||||||
|
|
||||||
print_header "Give permissions"
|
print_header "Give permissions"
|
||||||
set_permission severin 744 "${XDG_BIN_HOME}"
|
for permission in "${!PERMISSIONS[@]}"; do
|
||||||
|
set_permission "${USER}" "${PERMISSIONS[${permission}]}" "${permission}"
|
||||||
|
done
|
||||||
|
|
||||||
print_header "Add user to groups"
|
print_header "Add user to groups"
|
||||||
for group in "${ADD_GROUPS[@]}"
|
for group in "${ADD_GROUPS[@]}"
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
#######################################
|
#######################################
|
||||||
# Configuration variables
|
# Configuration variables
|
||||||
#######################################
|
#######################################
|
||||||
# Array of npm packages which should be installed globally
|
# npm packages which should be installed globally
|
||||||
NPM_PACKAGES=(
|
NPM_PACKAGES=(
|
||||||
"@vue/cli"
|
"@vue/cli"
|
||||||
"eslint"
|
"eslint"
|
||||||
|
@ -26,6 +26,7 @@ NPM_PACKAGES=(
|
||||||
"npm-check-updates"
|
"npm-check-updates"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Rust components which should be installed
|
||||||
RUST_COMPONENTS=(
|
RUST_COMPONENTS=(
|
||||||
"rls-preview"
|
"rls-preview"
|
||||||
"rustfmt-preview"
|
"rustfmt-preview"
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
file:///home/severin/Downloads Downloads
|
|
||||||
file:///home/severin/Documents Documents
|
file:///home/severin/Documents Documents
|
||||||
|
file:///home/severin/Downloads Downloads
|
||||||
|
file:///home/severin/Pictures Pictures
|
||||||
|
file:///home/severin/Music Music
|
||||||
|
file:///home/severin/Videos Videos
|
||||||
file:///home/severin/Projects Projects
|
file:///home/severin/Projects Projects
|
||||||
file:///home/severin/dotfiles dotfiles
|
file:///home/severin/dotfiles dotfiles
|
||||||
file:///home/severin/Notes Notes
|
file:///home/severin/Notes Notes
|
||||||
|
|
|
@ -20,3 +20,9 @@ yay -Syu --devel
|
||||||
|
|
||||||
print_section "Update npm packages"
|
print_section "Update npm packages"
|
||||||
npm update -g
|
npm update -g
|
||||||
|
|
||||||
|
print_section "Update composer packages"
|
||||||
|
composer global update
|
||||||
|
|
||||||
|
print_section "Update Rust components"
|
||||||
|
rustup update
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue