Merge branch 'install' of https://github.com/andrejusk/dotfiles
Clean scripts, remove sudo requirement Add python dependencies Correctly symlink and add poetry Update make clean Add python2 to dependencies Fix pyenv install Use pyenv to install python Update .gitignore Install git and keybase
This commit is contained in:
3
install/00-apt-pkglist
Normal file
3
install/00-apt-pkglist
Normal file
@@ -0,0 +1,3 @@
|
||||
curl
|
||||
net-tools
|
||||
openssh-server
|
||||
@@ -1,8 +1,14 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Always updates apt, upgrades apt, and installes 00-apt-pkglist
|
||||
#
|
||||
|
||||
apt-get -y update
|
||||
DEBIAN_FRONTEND=noninteractive apt-get -y \
|
||||
# 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
|
||||
apt-get -y autoremove
|
||||
apt-get -y autoclean
|
||||
-o Dpkg::Options::="--force-confold" upgrade -y
|
||||
|
||||
# Package installs
|
||||
pkglist=$(cat $install_dir/00-apt-pkglist)
|
||||
sudo apt-get install -y $pkglist
|
||||
|
||||
@@ -1,6 +1,44 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# After running this script:
|
||||
# 1. fish shell is installed
|
||||
# 2. fish shell is default login shell
|
||||
# 3. fish dotfiles are symlinked
|
||||
#
|
||||
|
||||
apt-add-repository -y ppa:fish-shell/release-3
|
||||
apt update
|
||||
apt-get -y install fish
|
||||
chsh -s `which fish`
|
||||
# 1. fish shell is installed
|
||||
if [ ! hash fish ] 2>/dev/null; then
|
||||
|
||||
printf "Installing fish...\n"
|
||||
|
||||
# Add fish repository
|
||||
sudo apt-add-repository -y ppa:fish-shell/release-3
|
||||
sudo apt-get -y update
|
||||
|
||||
# Install fish
|
||||
sudo apt-get -y install fish
|
||||
|
||||
fi
|
||||
printf "fish is installed\n"
|
||||
|
||||
# 2. fish shell is default login shell
|
||||
fish_path=$(which fish)
|
||||
if [ $SHELL != fish_path ]; then
|
||||
|
||||
printf "Setting fish as default...\n"
|
||||
|
||||
# Update default login shell
|
||||
chsh -s $fish_path $USER
|
||||
usermod -s $fish_path $USER
|
||||
|
||||
fi
|
||||
printf "fish is default login shell\n"
|
||||
|
||||
# 3. fish dotfiles are symlinked
|
||||
target="$HOME/.config/fish"
|
||||
for file in $(ls -d $script_dir/fish/*); do
|
||||
rel_path=$(realpath --relative-to="$target" "$file")
|
||||
printf "Linking $file to $target as $rel_path...\n"
|
||||
ln -sv $rel_path $target
|
||||
done
|
||||
printf "fish dotfiles linked\n"
|
||||
|
||||
14
install/10-git.sh
Normal file
14
install/10-git.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# After running this script:
|
||||
# 1. git dotfiles are symlinked
|
||||
#
|
||||
|
||||
# 1. git dotfiles are symlinked
|
||||
target="$HOME"
|
||||
for file in $(ls -d $script_dir/git/*); do
|
||||
rel_path=$(realpath --relative-to="$target" "$file")
|
||||
printf "Linking $file to $target as $rel_path...\n"
|
||||
ln -sv $rel_path $target
|
||||
done
|
||||
printf "git dotfiles linked\n"
|
||||
@@ -1,23 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
apt-get -y install \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg-agent \
|
||||
software-properties-common
|
||||
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||||
apt-key fingerprint 0EBFCD88
|
||||
|
||||
add-apt-repository -y \
|
||||
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
||||
$(lsb_release -cs) \
|
||||
stable"
|
||||
apt update
|
||||
apt install -y docker-ce
|
||||
systemctl status docker
|
||||
|
||||
curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
|
||||
chmod +x /usr/local/bin/docker-compose
|
||||
docker-compose --version
|
||||
16
install/11-keybase.sh
Normal file
16
install/11-keybase.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# After running this script:
|
||||
# 1. keybase is installed
|
||||
#
|
||||
|
||||
# 1.keybase is installed
|
||||
if [ ! hash fish ] 2>/dev/null; then
|
||||
|
||||
printf "Installing keybase...\n"
|
||||
|
||||
curl --remote-name https://prerelease.keybase.io/keybase_amd64.deb
|
||||
sudo apt install ./keybase_amd64.deb
|
||||
run_keybase
|
||||
|
||||
fi
|
||||
58
install/12-docker.sh
Normal file
58
install/12-docker.sh
Normal file
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# After running this script:
|
||||
# 1. docker is installed
|
||||
# 2. docker-compose if installed
|
||||
# 3. docker group exists
|
||||
# 4. user is in docker group
|
||||
#
|
||||
|
||||
# 1. docker is installed
|
||||
if ! hash docker 2>/dev/null; then
|
||||
|
||||
printf "Installing docker...\n"
|
||||
|
||||
# Requirements
|
||||
sudo apt-get -y install \
|
||||
apt-transport-https \
|
||||
ca-certificates \
|
||||
curl \
|
||||
gnupg-agent \
|
||||
software-properties-common
|
||||
|
||||
# Add repository
|
||||
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
|
||||
sudo add-apt-repository -y \
|
||||
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
|
||||
$(lsb_release -cs) \
|
||||
stable"
|
||||
sudo apt-get -y update
|
||||
|
||||
fi
|
||||
printf "docker is installed\n"
|
||||
|
||||
# 2. docker-compose if installed
|
||||
if ! hash docker-compose 2>/dev/null; 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"
|
||||
|
||||
# 3. docker group exists
|
||||
group='docker'
|
||||
if ! grep -q $group /etc/group; then
|
||||
sudo groupadd docker
|
||||
fi
|
||||
printf "group '$group' is created\n"
|
||||
|
||||
# 4. user is in docker group
|
||||
if ! groups $USER | grep -q "\b$group\b"; then
|
||||
sudo usermod -aG docker $USER
|
||||
fi
|
||||
printf "user '$USER' is in '$group' group\n"
|
||||
23
install/20-pyenv.sh
Normal file
23
install/20-pyenv.sh
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# After running this script:
|
||||
# 1. pyenv is installed
|
||||
#
|
||||
|
||||
# 1. pyenv is installed
|
||||
if ! hash pyenv 2>/dev/null; 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 pyenv
|
||||
# see https://github.com/pyenv/pyenv-installer
|
||||
curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash
|
||||
|
||||
fi
|
||||
printf "pyenv is installed\n"
|
||||
16
install/21-python.sh
Normal file
16
install/21-python.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# After running this script:
|
||||
# 1. python is installed
|
||||
#
|
||||
|
||||
# 1. python is installed
|
||||
if ! hash python 2>/dev/null; then
|
||||
|
||||
printf "Installing python...\n"
|
||||
|
||||
pyenv install -s 3.7.0
|
||||
pyenv global 3.7.0
|
||||
|
||||
fi
|
||||
printf "python is installed\n"
|
||||
16
install/22-poetry.sh
Normal file
16
install/22-poetry.sh
Normal file
@@ -0,0 +1,16 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# After running this script:
|
||||
# 1. poetry is installed
|
||||
#
|
||||
|
||||
# 1. poetry is installed
|
||||
if ! hash poetry 2>/dev/null; then
|
||||
|
||||
printf "Installing poetry...\n"
|
||||
|
||||
# Install poetry
|
||||
curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python3
|
||||
|
||||
fi
|
||||
printf "poetry is installed\n"
|
||||
5
install/99-apt-clean.sh
Normal file
5
install/99-apt-clean.sh
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Clean up
|
||||
sudo apt-get -y autoremove
|
||||
sudo apt-get -y autoclean
|
||||
Reference in New Issue
Block a user