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
|
||||
. ./system/.local/bin/utils
|
||||
|
||||
#######################################
|
||||
# Configuration variables
|
||||
#######################################
|
||||
###############################################################################
|
||||
# Configuration variables #
|
||||
###############################################################################
|
||||
# The user for the installation
|
||||
USER="severin"
|
||||
|
||||
# Array of directories which should be created
|
||||
# Directories which should be created
|
||||
DIRECTORIES=(
|
||||
".local/log"
|
||||
"Build"
|
||||
"Downloads"
|
||||
"Projects"
|
||||
"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=(
|
||||
".config/autokey"
|
||||
".config/bat"
|
||||
|
@ -62,6 +64,19 @@ LINKED_FILES_HOME=(
|
|||
".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
|
||||
ADD_GROUPS=(
|
||||
"bumblebee"
|
||||
|
@ -78,22 +93,33 @@ SYSTEMD_SERVICES=(
|
|||
#######################################
|
||||
# Main code
|
||||
#######################################
|
||||
print_header "Installing requirements"
|
||||
sudo pacman -S git base-devel --noconfirm --needed
|
||||
|
||||
print_header "Creating directories"
|
||||
for dir in "${DIRECTORIES[@]}"
|
||||
do
|
||||
create_directory "${dir}"
|
||||
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"
|
||||
#sudo pacman -S git base-devel --noconfirm
|
||||
|
||||
# Install yay
|
||||
#git clone https://aur.archlinux.org/yay.git
|
||||
#cd yay
|
||||
#makepkg -si --noconfirm --skippgpcheck
|
||||
#cd ..
|
||||
#rm -rf yay
|
||||
|
||||
package_count=$(cat "${PACKAGES_DIR}/packages.list" | wc -l)
|
||||
print_log "Installing "${package_count}" packages"
|
||||
# Install packages
|
||||
#yay -S --noconfirm $(cat "${PACKAGES_DIR}/packages.list")
|
||||
|
||||
|
@ -103,8 +129,16 @@ do
|
|||
create_link "${file}"
|
||||
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"
|
||||
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"
|
||||
for group in "${ADD_GROUPS[@]}"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
#######################################
|
||||
# Configuration variables
|
||||
#######################################
|
||||
# Array of npm packages which should be installed globally
|
||||
# npm packages which should be installed globally
|
||||
NPM_PACKAGES=(
|
||||
"@vue/cli"
|
||||
"eslint"
|
||||
|
@ -26,6 +26,7 @@ NPM_PACKAGES=(
|
|||
"npm-check-updates"
|
||||
)
|
||||
|
||||
# Rust components which should be installed
|
||||
RUST_COMPONENTS=(
|
||||
"rls-preview"
|
||||
"rustfmt-preview"
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
file:///home/severin/Downloads Downloads
|
||||
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/dotfiles dotfiles
|
||||
file:///home/severin/Notes Notes
|
||||
|
|
|
@ -20,3 +20,9 @@ yay -Syu --devel
|
|||
|
||||
print_section "Update npm packages"
|
||||
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