intsall fix attempts

add pyenv path after install

use https repository

install apt-utils

set FAST_MODE in bootstrap.sh

keep truthy FAST_MODE variable

source bashrc after linking

clean up errors

further install fixes

further cleanup

fix fisher install

chmod +x install

remove source bashrc from make
This commit is contained in:
Andrejus
2020-03-02 21:14:55 +00:00
parent e2bd54995a
commit 0d87c48e9c
23 changed files with 165 additions and 95 deletions

13
install/00-apt.sh Normal file → Executable file
View File

@@ -5,15 +5,16 @@
# Install list of packages in ./00-apt-pkglist
#
# apt update, upgrade if not fast
# pre clean
clean
# apt update, upgrade
update
if [ -z "$FAST_MODE" ]; then
upgrade
fi
upgrade
# Package installs
readonly package_list_file="$install_dir/00-apt-pkglist"
install_file $package_list_file
package_list_file="$install_dir/00-apt-pkglist"
install_file "$package_list_file"
# Log version
cat /etc/os-release

4
install/01-bash.sh Normal file → Executable file
View File

@@ -5,7 +5,7 @@
#
# 1. bash dotfiles are symlinked
readonly bash_source="$dotfiles_dir/bash"
readonly bash_target="$HOME"
bash_source="$dotfiles_dir/bash"
bash_target="$HOME"
link_folder "$bash_source" "$bash_target"
printf "bash dotfiles are linked\n"

36
install/02-fish.sh Normal file → Executable file
View File

@@ -4,6 +4,7 @@
# 1. fish shell is installed
# 2. fish shell is default login shell
# 3. fish dotfiles are symlinked
# 4. fisher is installed
#
# 1. fish shell is installed
@@ -12,24 +13,22 @@ if not_installed "fish"; then
printf "Installing fish...\n"
# Add fish repository
app_ppa "fish-shell/release-3"
add_ppa "fish-shell/release-3"
update
# Install fish
install fish
# Install fisher
set -q XDG_CONFIG_HOME; or set XDG_CONFIG_HOME ~/.config
curl https://git.io/fisher --create-dirs -sLo $XDG_CONFIG_HOME/fish/functions/fisher.fish
fish -c fisher
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
current_shell="$(getent passwd $USER | cut -d: -f7)"
fish_path="$(which fish)"
if [ "$current_shell" != "$fish_path" ]; then
printf "setting fish as default, current shell was $current_shell\n"
# Update default login shell
sudo chsh -s "$fish_path" "$USER"
@@ -39,7 +38,24 @@ fi
printf "fish is default login shell\n"
# 3. fish dotfiles are symlinked
readonly fish_source="$dotfiles_dir/fish"
readonly fish_target="$HOME/.config/fish"
fish_source="$dotfiles_dir/fish"
fish_target="$HOME/.config/fish"
link_folder "$fish_source" "$fish_target"
printf "fish dotfiles linked\n"
# 4. fisher is installed
XDG_CONFIG_HOME="$HOME/.config"
fisher_location="$XDG_CONFIG_HOME/fish/functions/fisher.fish"
if ! [ -f "$fisher_location" ]; then
printf "Installing fisher...\n"
# Install fisher
curl https://git.io/fisher --create-dirs -sLo "$fisher_location"
fi
printf "fisher is installed, updating...\n"
fish -c "fisher"
fish -c "fisher --version"
export XDG_CONFIG_HOME

8
install/03-ssh.sh Normal file → Executable file
View File

@@ -6,9 +6,9 @@
#
# 1. ssh key exists
readonly ssh_target="$HOME/.ssh"
readonly ssh_key="$ssh_target/id_rsa"
readonly ssh_pub="$ssh_key.pub"
ssh_target="$HOME/.ssh"
ssh_key="$ssh_target/id_rsa"
ssh_pub="$ssh_key.pub"
if [ ! -f "$ssh_key" ]; then
printf "generating ssh key...\n"
ssh-keygen -t rsa -b 4096 -f "$ssh_key"
@@ -16,7 +16,7 @@ fi
printf "ssh key exists\n"
# 2. ssh dotfiles are symlinked
readonly ssh_source="$dotfiles_dir/ssh"
ssh_source="$dotfiles_dir/ssh"
link_folder "$ssh_source" "$ssh_target"
printf "ssh dotfiles are symlinked\n"
cat "$ssh_pub"

4
install/04-git.sh Normal file → Executable file
View File

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

13
install/10-pyenv-pkglist Normal file
View File

@@ -0,0 +1,13 @@
build-essential
libssl-dev
libbz2-dev
libreadline-dev
libsqlite3-dev
llvm
libncurses5-dev
libncursesw5-dev
xz-utils
tk-dev
libffi-dev
liblzma-dev
python-openssl

16
install/10-pyenv.sh Normal file → Executable file
View File

@@ -5,30 +5,22 @@
#
# 1. pyenv is installed
export PYENV_ROOT="$HOME/.pyenv"
if not_installed "pyenv"; then
printf "Installing pyenv...\n"
# Install pyenv prerequisites
# see https://github.com/pyenv/pyenv/wiki/common-build-problems
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
pyenv_list_file="$install_dir/10-pyenv-pkglist"
install_file "$pyenv_list_file"
# Add to install path
add_path "$HOME/.pyenv/bin"
# Install pyenv
# see https://github.com/pyenv/pyenv-installer
run "https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer" \
"bash"
refresh
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
printf "pyenv is installed, upgrading...\n"
readonly pyenv_root=$(pyenv root)
git --git-dir="$pyenv_root" pull
git --git-dir="$PYENV_ROOT/.git" pull
pyenv --version

1
install/11-python.sh Normal file → Executable file
View File

@@ -11,7 +11,6 @@ if not_installed "pip3"; then
pyenv install 3.7.0
pyenv global 3.7.0
pyenv local 3.7.0
fi
printf "python3 and pip3 are installed, upgrading...\n"

0
install/12-poetry.sh Normal file → Executable file
View File

9
install/20-docker.sh Normal file → Executable file
View File

@@ -8,9 +8,13 @@
#
# 1. docker is installed
DOCKER_FOLDER="$HOME/.docker"
if not_installed "docker"; then
printf "Installing docker...\n"
# Create folder
mkdir -p "$DOCKER_FOLDER"
# Requirements
install apt-transport-https ca-certificates curl gnupg-agent \
@@ -28,8 +32,8 @@ if not_installed "docker"; then
install docker-ce
# Chown
sudo chown "$USER":"$USER" "$HOME/.docker" -R
sudo chmod g+rwx "$HOME/.docker" -R
sudo chown "$USER":"$USER" "$DOCKER_FOLDER" -R
sudo chmod g+rwx "$DOCKER_FOLDER" -R
fi
printf "docker is installed\n"
@@ -43,7 +47,6 @@ if not_installed "docker-compose"; then
# Docker-compose
pip3 install --user docker-compose
fi
printf "docker-compose is installed, upgrading\n"
pip3 install --upgrade docker-compose

0
install/21-keybase.sh Normal file → Executable file
View File

5
install/99-apt-clean.sh Normal file → Executable file
View File

@@ -1,5 +1,4 @@
#!/usr/bin/env bash
# Clean up
sudo apt-get -y autoremove
sudo apt-get -y autoclean
# post clean
clean

0
install/999-screenfetch.sh Normal file → Executable file
View File