75 lines
2.3 KiB
Bash
75 lines
2.3 KiB
Bash
#!/bin/bash
|
|
|
|
# Ubuntu Linux System Setup Module
|
|
|
|
ubuntu_install_system_base() {
|
|
log SECTION "Installing Ubuntu system base packages"
|
|
local section_start=$(date +%s)
|
|
|
|
if confirm "Install essential system packages?"; then
|
|
local packages=(
|
|
build-essential gawk imagemagick gpg ninja-build gettext cmake unzip curl
|
|
libssl-dev libffi-dev file libudev-dev pkg-config locales btop ncdu
|
|
ranger timeshift python3 python3-pip python3-venv python3-dev pipx
|
|
)
|
|
|
|
install_packages "${packages[@]}"
|
|
log SUCCESS "System base packages installed $(show_timer $section_start)"
|
|
fi
|
|
}
|
|
|
|
ubuntu_install_homebrew() {
|
|
log SECTION "Installing Homebrew"
|
|
local section_start=$(date +%s)
|
|
|
|
if confirm "Install Homebrew package manager?"; then
|
|
export NONINTERACTIVE=1
|
|
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
|
|
|
BREW_PREFIX="/home/linuxbrew/.linuxbrew"
|
|
if [ -d "$BREW_PREFIX" ]; then
|
|
eval "$("$BREW_PREFIX"/bin/brew shellenv)"
|
|
log SUCCESS "Homebrew installed $(show_timer $section_start)"
|
|
else
|
|
log ERROR "Homebrew installation failed"
|
|
return 1
|
|
fi
|
|
fi
|
|
}
|
|
|
|
ubuntu_setup_locale() {
|
|
log SECTION "Setting up locale"
|
|
sudo locale-gen "en_US.UTF-8"
|
|
sudo update-locale LANG=en_US.UTF-8
|
|
}
|
|
|
|
ubuntu_setup_shell_config() {
|
|
log SECTION "Setting up shell configuration"
|
|
|
|
if [ "${SYSTEM_INFO[WSL]}" == "yes" ]; then
|
|
ln -sf ~/linuxbox/bashrc_ubuntu ~/.bashrc
|
|
ln -sf ~/linuxbox/gitconfig.work ~/.gitconfig
|
|
else
|
|
ln -sf ~/linuxbox/bashrc_ubuntu ~/.bashrc
|
|
ln -sf ~/linuxbox/gitconfig ~/.gitconfig
|
|
|
|
mkdir -p ~/.config/alacritty
|
|
ln -sf ~/linuxbox/config/alacritty/alacritty.toml ~/.config/alacritty/alacritty.toml
|
|
fi
|
|
|
|
mkdir -p ~/.local/bin
|
|
ln -sf ~/linuxbox/update_wrapper.sh ~/.local/bin/update
|
|
ln -sf ~/linuxbox/start_nvim.sh ~/.local/bin/start_nvim
|
|
ln -sf ~/linuxbox/start_toolbox.sh ~/.local/bin/start_toolbox
|
|
}
|
|
|
|
ubuntu_setup_system() {
|
|
ubuntu_setup_locale
|
|
ubuntu_install_system_base
|
|
ubuntu_install_homebrew
|
|
ubuntu_setup_shell_config
|
|
}
|
|
|
|
if [ -z "$UBUNTU_SYSTEM_LOADED" ]; then
|
|
UBUNTU_SYSTEM_LOADED=true
|
|
fi |