Finishing touches

This commit is contained in:
2020-02-25 23:13:21 +00:00
committed by Andrejus
parent c4ce39b965
commit fc5ba9f99d
17 changed files with 157 additions and 121 deletions

View File

@@ -1,14 +1,15 @@
#!/bin/bash
#
# Always updates apt, upgrades apt, and installes 00-apt-pkglist
# apt update and upgrade
#
# Install list of packages in ./00-apt-pkglist
#
readonly package_list_file="00-apt-pkglist"
# apt update and upgrade non-interactively
sudo apt-get update -y
DEBIAN_FRONTEND=noninteractive sudo apt-get \
-o Dpkg::Options::="--force-confdef" \
-o Dpkg::Options::="--force-confold" upgrade -y
update
upgrade
# Package installs
readonly apt_pkglist=$(cat $install_dir/00-apt-pkglist)
sudo apt-get install -y $apt_pkglist
readonly package_list=$(cat $install_dir/$package_list_file)
install -y "$package_list"

View File

@@ -7,36 +7,33 @@
#
# 1. fish shell is installed
if [ is_missing fish ] 2>/dev/null
then
if not_installed "fish"; then
printf "Installing fish...\n"
# Add fish repository
sudo apt-add-repository -y ppa:fish-shell/release-3
sudo apt-get -y update
app_ppa fish-shell/release-3
update
# Install fish
sudo apt-get -y install fish
install fish
fi
printf "fish is installed\n"
fish --version
# 2. fish shell is default login shell
readonly fish_path=$(which fish)
if [ $SHELL != fish_path ]
then
printf "Setting fish as default...\n"
if [ "$SHELL" != fish_path ]; then
# Update default login shell
usermod -s $fish_path $USER
usermod -s "$fish_path" "$USER"
fi
printf "fish is default login shell\n"
# 3. fish dotfiles are symlinked
readonly fish_source="$dotfiles_dir/fish/*"
readonly fish_source="$dotfiles_dir/fish"
readonly fish_target="$HOME/.config/fish"
link_folder "$fish_source" "$fish_target"
printf "fish dotfiles linked\n"

View File

@@ -5,7 +5,7 @@
#
# 1. git dotfiles are symlinked
readonly git_source="$dotfiles_dir/git/*"
readonly git_source="$dotfiles_dir/git"
readonly git_target="$HOME"
link_folder $git_source $git_target
link_folder "$git_source" "$git_target"
printf "git dotfiles linked\n"

View File

@@ -5,14 +5,15 @@
#
# 1.keybase is installed
if [ ! hash keybase ] 2>/dev/null
then
if not_installed "keybase"; then
printf "Installing keybase...\n"
curl --remote-name https://prerelease.keybase.io/keybase_amd64.deb
sudo apt-get install -y ./keybase_amd64.deb
run_keybase
install ./keybase_amd64.deb
rm ./keybase_amd64.deb
fi
printf "keybase is installed\n"
run_keybase
keybase --version

View File

@@ -8,13 +8,12 @@
#
# 1. docker is installed
if ! hash docker 2>/dev/null
then
if not_installed "docker"; then
printf "Installing docker...\n"
# Requirements
sudo apt-get -y install \
install \
apt-transport-https \
ca-certificates \
curl \
@@ -22,41 +21,42 @@ then
software-properties-common
# Add repository
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add_key https://download.docker.com/linux/ubuntu/gpg
sudo add-apt-repository -y \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get -y update
$(lsb_release -cs) \
stable"
update
# Install
install docker-ce
fi
printf "docker is installed\n"
docker --version
# 2. docker-compose if installed
if ! hash docker-compose 2>/dev/null
then
if not_installed "docker-compose"; then
printf "Installing docker-compose...\n"
# Docker-compose
curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
fi
printf "docker-compose is installed\n"
docker-compose --version
# 3. docker group exists
readonly docker_group='docker'
if ! grep -q $docker_group /etc/group
then
sudo groupadd $docker_group
if ! grep -q "$docker_group" /etc/group; then
sudo groupadd "$docker_group"
fi
printf "group '$docker_group' is created\n"
# 4. user is in docker group
if ! groups $USER | grep -q "\b$docker_group\b"
then
sudo usermod -aG docker $USER
if ! groups $USER | grep -q "\b$docker_group\b"; then
sudo usermod -aG docker "$USER"
fi
printf "user '$USER' is in '$docker_group' group\n"

View File

@@ -5,20 +5,22 @@
#
# 1. pyenv is installed
if ! hash pyenv 2>/dev/null
then
if not_installed "pyenv"; then
printf "Installing pyenv...\n"
# Install pyenv prerequisites
# see https://github.com/pyenv/pyenv/wiki/common-build-problems
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
install make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev python-openssl git
# Install pyenv
# see https://github.com/pyenv/pyenv-installer
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
run https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer bash
# Add to install path
export PATH="$HOME/.pyenv/bin:$PATH"
fi
printf "pyenv is installed\n"

View File

@@ -5,8 +5,7 @@
#
# 1. python is installed
if ! hash python 2>/dev/null
then
if not_installed "python"; then
printf "Installing python...\n"

View File

@@ -5,13 +5,12 @@
#
# 1. poetry is installed
if ! hash poetry 2>/dev/null
then
if not_installed "poetry"; then
printf "Installing poetry...\n"
# Install poetry
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
run https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py python3
fi
printf "poetry is installed\n"

View File

@@ -1,5 +1,5 @@
#!/bin/bash
# Clean up
sudo apt-get -y autoremove
sudo apt-get -y autoclean
sudo apt-get -qqy autoremove
sudo apt-get -qqy autoclean