2015-12-19 12:40:48 +01:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# install.sh
|
2019-10-15 22:02:16 +02:00
|
|
|
# This script installs a basic setup for a debian machine
|
2015-12-19 12:40:48 +01:00
|
|
|
|
|
|
|
USERNAME=fschl
|
2018-10-23 18:22:03 +02:00
|
|
|
SUDO="sudo"
|
|
|
|
|
|
|
|
check_root() {
|
|
|
|
# We need root rights at some point
|
|
|
|
if [ "$(whoami)" != "root" ]; then
|
2019-01-02 12:42:16 +01:00
|
|
|
if ! which $SUDO >/dev/null; then
|
|
|
|
echo "ERROR: $0 is not run as root and $SUDO is not available" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2018-10-23 18:22:03 +02:00
|
|
|
else
|
2019-01-02 12:42:16 +01:00
|
|
|
SUDO="" # We're already root
|
2018-10-23 18:22:03 +02:00
|
|
|
fi
|
|
|
|
}
|
2015-12-19 12:40:48 +01:00
|
|
|
|
|
|
|
apt_sources() {
|
2019-10-15 22:02:16 +02:00
|
|
|
# https://www.debian.org/releases/
|
2018-10-23 18:22:03 +02:00
|
|
|
ddist=$1
|
|
|
|
DIST="${ddist:-stable}"
|
2019-01-02 12:42:16 +01:00
|
|
|
|
2021-09-19 00:34:34 +02:00
|
|
|
allowed_dists=("testing stable buster bullseye")
|
2019-01-02 12:42:16 +01:00
|
|
|
if [ ! ${DIST} in "${allowed_dists[@]}" ]; then
|
|
|
|
echo "... $DIST was not in allowed dists... setting to stable"
|
|
|
|
DIST="stable"
|
2018-06-14 09:51:51 +02:00
|
|
|
fi
|
2019-01-02 12:42:16 +01:00
|
|
|
|
|
|
|
echo "writing /etc/apt/sources.list..."
|
|
|
|
echo "using ${DIST}"
|
|
|
|
cat <<-EOF > /etc/apt/sources.list
|
|
|
|
deb http://deb.debian.org/debian ${DIST} main
|
|
|
|
deb-src http://deb.debian.org/debian ${DIST} main
|
|
|
|
|
|
|
|
deb http://deb.debian.org/debian-security/ ${DIST}/updates main
|
|
|
|
deb-src http://deb.debian.org/debian-security/ ${DIST}/updates main
|
|
|
|
|
2021-04-03 20:47:40 +02:00
|
|
|
# backports for wireguard
|
|
|
|
# https://www.wireguard.com/install/
|
|
|
|
# https://backports.debian.org/Instructions/
|
|
|
|
deb http://deb.debian.org/debian buster-backports main
|
|
|
|
|
2019-01-02 12:42:16 +01:00
|
|
|
deb http://deb.debian.org/debian ${DIST}-updates main
|
|
|
|
deb-src http://deb.debian.org/debian ${DIST}-updates main
|
|
|
|
EOF
|
2015-12-19 12:40:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
base_applications() {
|
2016-07-01 01:37:22 +02:00
|
|
|
echo "update and installing baseapps..."
|
|
|
|
|
2018-10-23 18:22:03 +02:00
|
|
|
$SUDO apt update
|
|
|
|
$SUDO apt upgrade
|
2017-03-07 18:05:01 +01:00
|
|
|
|
|
|
|
DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2018-10-23 18:22:03 +02:00
|
|
|
$SUDO apt install -y \
|
2017-03-07 18:05:01 +01:00
|
|
|
apt-transport-https \
|
|
|
|
automake \
|
|
|
|
bash-completion \
|
2021-11-04 23:42:24 +01:00
|
|
|
bat \
|
2017-03-07 18:05:01 +01:00
|
|
|
bmon \
|
|
|
|
bzip2 \
|
|
|
|
ca-certificates \
|
|
|
|
cmake \
|
|
|
|
coreutils \
|
2018-11-12 11:48:01 +01:00
|
|
|
cryptsetup \
|
2017-03-07 18:05:01 +01:00
|
|
|
curl \
|
|
|
|
dnsutils \
|
2021-11-04 23:42:24 +01:00
|
|
|
fzf \
|
2017-03-07 18:05:01 +01:00
|
|
|
gcc \
|
|
|
|
git \
|
|
|
|
gnupg \
|
2019-01-02 12:42:16 +01:00
|
|
|
gnupg-agent \
|
2018-05-28 19:55:53 +02:00
|
|
|
gnupg2 \
|
2017-03-07 18:05:01 +01:00
|
|
|
grep \
|
|
|
|
htop \
|
|
|
|
iotop \
|
|
|
|
locales \
|
2021-04-03 20:47:40 +02:00
|
|
|
linux-headers-$(uname -r) \
|
2017-03-07 18:05:01 +01:00
|
|
|
make \
|
|
|
|
mount \
|
|
|
|
net-tools \
|
2021-11-04 23:42:24 +01:00
|
|
|
restic \
|
|
|
|
ripgrep \
|
2017-03-07 18:05:01 +01:00
|
|
|
rsync \
|
|
|
|
ssh \
|
|
|
|
sudo \
|
|
|
|
tar \
|
|
|
|
tmux \
|
|
|
|
tree \
|
2018-11-12 11:48:01 +01:00
|
|
|
unzip \
|
2017-03-07 18:05:01 +01:00
|
|
|
vim \
|
2019-09-19 14:44:28 +02:00
|
|
|
vpnc \
|
|
|
|
vpnc-scripts \
|
2021-04-03 20:47:40 +02:00
|
|
|
wireguard \
|
2021-05-16 21:45:43 +02:00
|
|
|
wireguard-dkms \
|
|
|
|
wireguard-tools \
|
2017-03-07 18:05:01 +01:00
|
|
|
zip \
|
|
|
|
--no-install-recommends
|
2015-12-19 12:40:48 +01:00
|
|
|
|
2022-01-27 20:02:27 +01:00
|
|
|
$SUDO restic self-update
|
2016-07-01 01:37:22 +02:00
|
|
|
echo "... DONE... cleaning up\n\n"
|
2018-10-23 18:22:03 +02:00
|
|
|
$SUDO apt autoremove
|
|
|
|
$SUDO apt autoclean
|
|
|
|
$SUDO apt clean
|
2017-01-04 23:44:35 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
install_server_base() {
|
|
|
|
echo "update and installing server base tools..."
|
2017-03-07 18:05:01 +01:00
|
|
|
|
|
|
|
DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2022-04-02 09:56:50 +02:00
|
|
|
$SUDO apt update
|
|
|
|
$SUDO apt install -y \
|
2017-03-07 18:05:01 +01:00
|
|
|
fail2ban \
|
|
|
|
logwatch \
|
|
|
|
unattended-upgrades \
|
|
|
|
--no-install-recommends
|
2017-01-04 23:44:35 +01:00
|
|
|
|
|
|
|
echo "... DONE... cleaning up\n\n"
|
2022-04-02 09:56:50 +02:00
|
|
|
$SUDO apt autoremove
|
|
|
|
$SUDO apt autoclean
|
|
|
|
$SUDO apt clean
|
2017-01-04 23:44:35 +01:00
|
|
|
|
|
|
|
echo "setting up logwatch..."
|
2019-01-02 12:42:16 +01:00
|
|
|
echo "... TODO require email to be set as parameter"
|
|
|
|
echo "... TODO require email to be set as parameter"
|
2017-01-04 23:44:35 +01:00
|
|
|
cat <<-EOF > /etc/cron.daily/00logwatch
|
|
|
|
/usr/sbin/logwatch --output mail --mailto you@example.com --detail high
|
|
|
|
|
|
|
|
EOF
|
|
|
|
echo " ... DONE"
|
|
|
|
|
2019-01-02 12:42:16 +01:00
|
|
|
# TODO: is this really needed? or default behavior anyway?
|
2017-01-04 23:44:35 +01:00
|
|
|
echo "set unattended upgrades..."
|
|
|
|
cat <<-EOF > /etc/apt/apt.conf.d/10periodic
|
|
|
|
APT::Periodic::Update-Package-Lists "1";
|
|
|
|
APT::Periodic::Download-Upgradeable-Packages "1";
|
|
|
|
APT::Periodic::AutocleanInterval "7";
|
|
|
|
APT::Periodic::Unattended-Upgrade "1";
|
|
|
|
EOF
|
2016-08-10 16:33:19 +02:00
|
|
|
|
2022-04-02 09:56:50 +02:00
|
|
|
echo " ... DONE"
|
2015-12-19 12:40:48 +01:00
|
|
|
}
|
|
|
|
|
2016-08-26 13:46:32 +02:00
|
|
|
no_suspend() {
|
|
|
|
# https://wiki.debian.org/SystemdSuspendSedation
|
2018-10-23 18:22:03 +02:00
|
|
|
$SUDO sed -i "s/HandleLidSwitch=.*/HandleLidSwitch=ignore/" /etc/systemd/logind.conf
|
|
|
|
$SUDO sed -i "s/HandleLidSwitchDocked=.*/HandleLidSwitchDocked=ignore/" /etc/systemd/logind.conf
|
|
|
|
$SUDO sed -i "s/IdleActionSec=.*/IdleActionSec=90min/" /etc/systemd/logind.conf
|
2016-09-12 11:00:50 +02:00
|
|
|
|
2017-01-04 23:44:35 +01:00
|
|
|
# turn off screen blanking
|
|
|
|
# https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=18200&sid=135af53eb82496bc64f4c0eefbc86d2c&start=25
|
|
|
|
# http://raspberrypi.stackexchange.com/questions/752/how-do-i-prevent-the-screen-from-going-blank
|
|
|
|
xset s noblank
|
|
|
|
|
2018-10-23 18:22:03 +02:00
|
|
|
$SUDO systemctl restart systemd-logind.service
|
2016-08-26 13:46:32 +02:00
|
|
|
}
|
|
|
|
|
2018-11-12 11:48:09 +01:00
|
|
|
install_nvidia_docker() {
|
|
|
|
# get latest driver from https://www.nvidia.com/object/unix.html
|
|
|
|
# https://github.com/NVIDIA/nvidia-docker/wiki/Installation-(version-2.0)#prerequisites
|
|
|
|
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | \
|
|
|
|
sudo tee /etc/apt/sources.list.d/nvidia-docker.list
|
|
|
|
sudo apt-get update
|
|
|
|
|
|
|
|
# Install nvidia-docker2 and reload the Docker daemon configuration
|
|
|
|
sudo apt-get install -y nvidia-docker2
|
|
|
|
sudo pkill -SIGHUP dockerd
|
|
|
|
}
|
2019-01-02 12:42:16 +01:00
|
|
|
|
2019-01-14 23:28:37 +01:00
|
|
|
install_latex() {
|
2022-04-02 09:56:50 +02:00
|
|
|
$SUDO apt update
|
|
|
|
$SUDO apt install -y \
|
2019-01-14 23:28:37 +01:00
|
|
|
evince \
|
|
|
|
texlive \
|
|
|
|
texlive-bibtex-extra \
|
2020-11-07 19:05:22 +01:00
|
|
|
texlive-fonts-extra \
|
|
|
|
texlive-fonts-recommended \
|
2019-01-14 23:28:37 +01:00
|
|
|
texlive-lang-english \
|
|
|
|
texlive-lang-german \
|
|
|
|
texlive-latex-extra \
|
|
|
|
texlive-latex-recommended \
|
|
|
|
texlive-pictures \
|
2021-06-03 07:45:13 +02:00
|
|
|
texlive-plain-generic \
|
2020-11-07 19:05:22 +01:00
|
|
|
zathura \
|
2019-01-14 23:28:37 +01:00
|
|
|
--no-install-recommends
|
|
|
|
}
|
|
|
|
|
2021-10-30 10:08:00 +02:00
|
|
|
install_workstation_apps() {
|
2017-03-07 18:05:01 +01:00
|
|
|
DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2022-01-27 20:02:27 +01:00
|
|
|
$SUDO apt update
|
|
|
|
$SUDO apt install -y \
|
2021-11-04 23:42:24 +01:00
|
|
|
alsa-tools \
|
2017-03-07 18:05:01 +01:00
|
|
|
alsa-utils \
|
2018-05-28 19:55:53 +02:00
|
|
|
aspell \
|
|
|
|
aspell-de \
|
|
|
|
aspell-en \
|
2020-02-19 12:02:41 +01:00
|
|
|
cups-browsed \
|
2018-12-22 20:09:58 +01:00
|
|
|
emacs \
|
2019-01-02 12:42:16 +01:00
|
|
|
firefox-esr \
|
2019-07-31 16:51:10 +02:00
|
|
|
firmware-iwlwifi \
|
|
|
|
firmware-linux-nonfree \
|
|
|
|
firmware-realtek \
|
2018-05-28 19:55:53 +02:00
|
|
|
fonts-font-awesome \
|
2019-01-05 13:25:59 +01:00
|
|
|
fonts-noto \
|
|
|
|
fonts-noto-cjk \
|
2021-11-08 11:33:26 +01:00
|
|
|
fonts-powerline \
|
2019-07-31 16:51:10 +02:00
|
|
|
gimp \
|
2018-12-27 23:36:11 +01:00
|
|
|
keepassxc \
|
2021-09-19 00:34:34 +02:00
|
|
|
libnotify-bin \
|
|
|
|
libnotify-dev \
|
2019-01-14 23:28:37 +01:00
|
|
|
libreoffice-calc \
|
|
|
|
libreoffice-impress \
|
|
|
|
libreoffice-l10n-de \
|
|
|
|
libreoffice-l10n-en-gb \
|
2019-03-22 16:27:40 +01:00
|
|
|
libreoffice-writer \
|
2021-10-30 10:08:00 +02:00
|
|
|
ntfs-3g \
|
2021-11-08 11:33:26 +01:00
|
|
|
network-manager \
|
|
|
|
network-manager-openvpn \
|
2021-10-30 10:08:00 +02:00
|
|
|
nmap \
|
2021-11-08 11:33:26 +01:00
|
|
|
openvpn \
|
|
|
|
openvpn-systemd-resolved \
|
2021-10-30 10:08:00 +02:00
|
|
|
thunderbird \
|
|
|
|
thunderbird-l10n-de \
|
|
|
|
thunderbird-l10n-en-gb \
|
|
|
|
--no-install-recommends
|
|
|
|
|
|
|
|
TARGET="/home/$USERNAME/.emacs.d"
|
2022-02-12 16:51:21 +01:00
|
|
|
rm -rf ${TARGET}
|
2021-10-30 10:08:00 +02:00
|
|
|
git clone https://github.com/syl20bnr/spacemacs "${TARGET}"
|
|
|
|
# rm -rf "${TARGET}"/private/snippets
|
|
|
|
# git clone https://github.com/AndreaCrotti/yasnippet-snippets "${TARGET}"/private/yas-snippets
|
|
|
|
# ln -s "${TARGET}"/private/yas-snips/snippets "${TARGET}"/private/snippets/
|
|
|
|
}
|
|
|
|
|
|
|
|
install_sway() {
|
2021-11-04 23:42:24 +01:00
|
|
|
echo " installing sway and wayland tools..."
|
|
|
|
DEBIAN_FRONTEND=noninteractive
|
2022-04-02 09:56:50 +02:00
|
|
|
$SUDO apt update
|
|
|
|
$SUDO apt install -y \
|
2021-11-04 23:42:24 +01:00
|
|
|
brightnessctl \
|
2021-11-08 11:33:26 +01:00
|
|
|
mako \
|
2021-11-04 23:42:24 +01:00
|
|
|
sway \
|
2021-11-08 11:33:26 +01:00
|
|
|
udiskie \
|
|
|
|
udisks2 \
|
2021-11-04 23:42:24 +01:00
|
|
|
wl-clipboard \
|
|
|
|
wob \
|
|
|
|
wofi \
|
|
|
|
ydotool \
|
|
|
|
--no-install-recommends
|
|
|
|
|
2021-11-08 11:33:26 +01:00
|
|
|
mv /home/${USERNAME}/.bashrc /home/${USERNAME}/.bashrc~
|
2021-11-10 16:29:36 +01:00
|
|
|
ln -s /home/${USERNAME}/dotfiles/.bashrc /home/${USERNAME}/.bashrc
|
2021-11-08 11:33:26 +01:00
|
|
|
cp ../sway/mako.conf /home/${USERNAME}/.config/mako/conf
|
2021-11-04 23:42:24 +01:00
|
|
|
|
2021-11-10 16:29:36 +01:00
|
|
|
(
|
|
|
|
git clone https://github.com/Biont/sway-launcher-desktop /home/${USERNAME}/projects/sway-launcher-desktop
|
|
|
|
)
|
|
|
|
|
|
|
|
# build swaylock-effects because its not available on Debian
|
|
|
|
# https://github.com/voidgloom/swaylock-effects
|
|
|
|
(
|
2022-04-02 09:56:50 +02:00
|
|
|
$SUDO apt update
|
|
|
|
$SUDO apt install -y \
|
2021-11-10 16:29:36 +01:00
|
|
|
wayland-protocols \
|
|
|
|
libwayland-client++0 \
|
|
|
|
libcairo2-dev \
|
|
|
|
libwayland-client0 \
|
|
|
|
--no-install-recommends
|
|
|
|
|
|
|
|
TARGET=/home/${USERNAME}/projects/swaylock-effects
|
|
|
|
git clone https://github.com/voidgloom/swaylock-effects ${TARGET}
|
|
|
|
cd ${TARGET}
|
|
|
|
meson build && ninja -C build && sudo ninja -C build install
|
2022-04-02 09:56:50 +02:00
|
|
|
$SUDO chmod a+s /usr/local/bin/swaylock
|
2021-11-10 16:29:36 +01:00
|
|
|
)
|
|
|
|
|
2021-10-30 10:08:00 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
install_i3() {
|
2021-11-04 23:42:24 +01:00
|
|
|
echo "Xorg with i3wm and some tools..."
|
2021-10-30 10:08:00 +02:00
|
|
|
|
|
|
|
# check if CJK and other eastern letters are displayed correctly:
|
|
|
|
# https://meta.wikimedia.org/wiki/List_of_Wikipedias
|
|
|
|
|
|
|
|
DEBIAN_FRONTEND=noninteractive
|
|
|
|
|
2022-01-27 20:02:27 +01:00
|
|
|
$SUDO apt update
|
|
|
|
$SUDO apt install -y \
|
2021-10-30 10:08:00 +02:00
|
|
|
feh \
|
|
|
|
fswebcam \
|
|
|
|
i3 \
|
|
|
|
i3lock \
|
|
|
|
i3lock-fancy \
|
|
|
|
i3status \
|
2022-01-27 20:02:27 +01:00
|
|
|
lightdm \
|
2019-01-05 13:25:59 +01:00
|
|
|
network-manager-gnome \
|
2019-09-19 14:44:28 +02:00
|
|
|
network-manager-vpnc \
|
|
|
|
network-manager-vpnc-gnome \
|
|
|
|
remmina \
|
2022-01-27 20:02:27 +01:00
|
|
|
rxvt-unicode \
|
2017-03-07 18:05:01 +01:00
|
|
|
scrot \
|
|
|
|
shotwell \
|
2022-01-27 20:02:27 +01:00
|
|
|
suckless-tools \
|
2019-07-31 16:51:10 +02:00
|
|
|
vlc \
|
2021-11-04 23:42:24 +01:00
|
|
|
xdotool \
|
2017-03-07 18:05:01 +01:00
|
|
|
xorg \
|
|
|
|
--no-install-recommends
|
2016-07-01 01:37:22 +02:00
|
|
|
|
2022-01-27 20:02:27 +01:00
|
|
|
# for f in (); do
|
|
|
|
# ln -s $f /home/$USER/$f
|
|
|
|
# done
|
|
|
|
|
2021-10-30 10:06:40 +02:00
|
|
|
echo "... setting capslock to control"
|
2022-01-27 20:02:27 +01:00
|
|
|
$SUDO sed -i "s/^XKBOPTIONS=.*/XKBOPTIONS=\"ctrl:nocaps\"/" /etc/default/keyboard
|
2021-10-30 10:06:40 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
install_syncthing() {
|
2021-09-19 00:34:34 +02:00
|
|
|
# install Syncthing via https://apt.syncthing.net/
|
2020-11-07 19:05:22 +01:00
|
|
|
# Add the release PGP keys:
|
|
|
|
curl -s https://syncthing.net/release-key.txt | sudo apt-key add -
|
|
|
|
|
|
|
|
# Add the "stable" channel to your APT sources:
|
2022-01-27 20:02:27 +01:00
|
|
|
cat "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
|
2020-11-07 19:05:22 +01:00
|
|
|
|
2021-09-19 00:34:34 +02:00
|
|
|
# pin the correct apt repo
|
|
|
|
printf "Package: *\nPin: origin apt.syncthing.net\nPin-Priority: 990\n" | sudo tee /etc/apt/preferences.d/syncthing
|
|
|
|
|
2020-11-07 19:05:22 +01:00
|
|
|
# Update and install syncthing:
|
2022-01-27 20:02:27 +01:00
|
|
|
$SUDO apt-get update
|
2022-04-02 09:56:50 +02:00
|
|
|
$SUDO apt-get install -y syncthing
|
2016-07-01 01:37:22 +02:00
|
|
|
echo "... DONE... cleaning up\n\n"
|
2022-01-27 20:02:27 +01:00
|
|
|
$SUDO apt autoremove
|
|
|
|
$SUDO apt autoclean
|
|
|
|
$SUDO apt clean
|
2016-08-26 13:46:32 +02:00
|
|
|
|
2021-10-30 10:06:40 +02:00
|
|
|
echo "enable and start the syncthing per-user service for ${USERNAME}"
|
2022-01-27 20:02:27 +01:00
|
|
|
$SUDO cp ../etc/systemd/system/syncth* /etc/systemd/system/
|
2021-10-30 10:06:40 +02:00
|
|
|
user=${USERNAME}
|
2022-01-27 20:02:27 +01:00
|
|
|
$SUDO systemctl daemon-reload
|
|
|
|
$SUDO systemctl enable syncthing@${USERNAME}
|
|
|
|
$SUDO systemctl start syncthing@${USERNAME}.service
|
2021-10-30 10:06:40 +02:00
|
|
|
systemctl status syncthing@${USERNAME}.service
|
2017-03-07 15:35:53 +01:00
|
|
|
|
2019-10-15 22:02:16 +02:00
|
|
|
no_suspend
|
|
|
|
|
|
|
|
echo "... setting capslock to control"
|
|
|
|
sed -i "s/^XKBOPTIONS=.*/XKBOPTIONS=\"ctrl:nocaps\"/" /etc/default/keyboard
|
|
|
|
|
|
|
|
TARGET="/home/$USERNAME/.emacs.d"
|
|
|
|
git clone https://github.com/syl20bnr/spacemacs "${TARGET}"
|
|
|
|
#rm -rf "${TARGET}"/private/snippets
|
|
|
|
#git clone https://github.com/AndreaCrotti/yasnippet-snippets "${TARGET}"/private/yas-snips
|
|
|
|
#ln -s "${TARGET}"/private/yas-snips/snippets "${TARGET}"/private/snippets/
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
link_userdirs() {
|
|
|
|
|
|
|
|
mount_dir=$1
|
|
|
|
target_mount="${mount_dir:-/mnt/docs/}"
|
|
|
|
user_dirs=("Documents Downloads Music Pictures Videos")
|
|
|
|
for DIR in $user_dirs
|
|
|
|
do
|
|
|
|
echo "removing and linking ${DIR}..."
|
|
|
|
rm -rfv /home/$USERNAME/$DIR
|
|
|
|
echo "link target: ${target_mount}/${DIR}"
|
|
|
|
ln -vs ${target_mount}/${DIR} /home/${USERNAME}/${DIR}
|
|
|
|
done
|
|
|
|
|
|
|
|
projects_mount=$docs_mount
|
2015-12-20 23:49:15 +01:00
|
|
|
}
|
|
|
|
|
2019-10-15 20:36:22 +02:00
|
|
|
install_vscodium() {
|
|
|
|
# https://vscodium.com/
|
|
|
|
|
|
|
|
wget -qO - https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/master/pub.gpg | sudo apt-key add -
|
|
|
|
|
|
|
|
echo 'deb https://gitlab.com/paulcarroty/vscodium-deb-rpm-repo/raw/repos/debs/ vscodium main' | sudo tee --append /etc/apt/sources.list.d/vscodium.list
|
|
|
|
|
2022-01-27 20:02:27 +01:00
|
|
|
$SUDO apt update
|
|
|
|
$SUDO apt install -y \
|
2019-10-15 20:36:22 +02:00
|
|
|
codium \
|
|
|
|
--no-install-recommends
|
|
|
|
|
|
|
|
codium version
|
|
|
|
|
|
|
|
# ms-azuretools.vscode-docker
|
|
|
|
# ms-vscode.go
|
|
|
|
# vscodevim.vim
|
|
|
|
}
|
|
|
|
|
2021-12-02 12:21:25 +01:00
|
|
|
install_wine() {
|
|
|
|
|
|
|
|
# https://wiki.winehq.org/Debian
|
|
|
|
curl https://dl.winehq.org/wine-builds/winehq.key | gpg --dearmor > /etc/apt/trusted.gpg.d/winehq.gpg
|
2022-01-27 20:02:27 +01:00
|
|
|
echo 'deb https://dl.winehq.org/wine-builds/debian/ bookworm main' | sudo tee /etc/apt/sources.list.d/wine.list
|
2021-12-02 12:21:25 +01:00
|
|
|
|
2022-01-27 20:02:27 +01:00
|
|
|
$SUDO sudo dpkg --add-architecture i386
|
|
|
|
$SUDO apt update
|
|
|
|
$SUDO apt install \
|
2021-12-02 12:21:25 +01:00
|
|
|
winehq-staging \
|
2022-01-27 20:02:27 +01:00
|
|
|
--install-recommends
|
2021-12-02 12:21:25 +01:00
|
|
|
|
2022-01-27 20:02:27 +01:00
|
|
|
wine --version
|
2021-12-02 12:21:25 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-12-20 23:49:15 +01:00
|
|
|
install_docker() {
|
2018-06-14 09:44:12 +02:00
|
|
|
# https://docs.docker.com/install/linux/docker-ce/debian/#install-using-the-repository
|
|
|
|
|
|
|
|
# bad experiences with static binaries...
|
2017-03-07 15:35:53 +01:00
|
|
|
# https://docs.docker.com/engine/installation/binaries/#install-static-binaries
|
|
|
|
echo "installing docker binary Version $VERS ..."
|
|
|
|
# https://github.com/tianon/cgroupfs-mount/blob/master/cgroupfs-mount
|
|
|
|
|
2022-01-27 20:02:27 +01:00
|
|
|
$SUDO apt install -y \
|
2018-06-14 09:44:12 +02:00
|
|
|
apt-transport-https \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
gnupg2 \
|
2018-10-23 18:22:03 +02:00
|
|
|
software-properties-common \
|
|
|
|
--no-install-recommends
|
2018-06-14 09:44:12 +02:00
|
|
|
|
2018-10-23 18:22:03 +02:00
|
|
|
curl -fsSL https://download.docker.com/linux/debian/gpg | $SUDO apt-key add -
|
2018-06-14 09:44:12 +02:00
|
|
|
|
|
|
|
# add docker apt repo
|
|
|
|
cat <<-EOF > /etc/apt/sources.list.d/docker.list
|
2019-10-15 20:35:23 +02:00
|
|
|
deb [arch=amd64] https://download.docker.com/linux/debian buster stable
|
|
|
|
# deb [arch=amd64] https://download.docker.com/linux/debian buster test
|
|
|
|
# deb [arch=amd64] https://download.docker.com/linux/debian buster nightly
|
2018-06-14 09:44:12 +02:00
|
|
|
EOF
|
|
|
|
|
2022-01-27 20:02:27 +01:00
|
|
|
$SUDO apt update
|
|
|
|
$SUDO apt install -y \
|
2018-10-23 18:22:03 +02:00
|
|
|
docker-ce \
|
|
|
|
--no-install-recommends
|
|
|
|
|
2022-04-02 09:56:50 +02:00
|
|
|
$SUDO usermod -aG docker ${USERNAME}
|
2017-03-07 15:35:53 +01:00
|
|
|
|
2018-10-23 18:22:03 +02:00
|
|
|
docker version
|
|
|
|
docker info
|
2016-07-01 01:37:22 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
install_compose() {
|
2017-03-07 18:05:48 +01:00
|
|
|
# https://github.com/docker/compose/releases
|
2018-06-02 17:17:29 +02:00
|
|
|
# btw: *not* for raspbian! you got 3 choices: hypriot, install via pip or build yourself
|
|
|
|
# https://www.berthon.eu/2017/getting-docker-compose-on-raspberry-pi-arm-the-easy-way/
|
2021-11-04 23:42:24 +01:00
|
|
|
VERS="1.29.2"
|
2018-06-02 17:17:29 +02:00
|
|
|
FILE="docker-compose-$(uname -s)-$(uname -m)"
|
2016-07-01 01:37:22 +02:00
|
|
|
echo "installing docker-compose $VERS ... curling from github"
|
|
|
|
|
2018-06-02 17:17:29 +02:00
|
|
|
curl -SL "https://github.com/docker/compose/releases/download/${VERS}/${FILE}" -o /tmp/${FILE}
|
|
|
|
curl -SL "https://github.com/docker/compose/releases/download/${VERS}/${FILE}.sha256" -o /tmp/${FILE}.sha256
|
|
|
|
|
|
|
|
if [ ! $(cat /tmp/${FILE}.sha256 | sha256sum -c -) ]; then
|
|
|
|
echo "... checksum failed... stopping"
|
|
|
|
exit 1;
|
|
|
|
fi
|
2017-03-07 18:05:48 +01:00
|
|
|
|
2018-06-02 17:17:29 +02:00
|
|
|
chmod +x /tmp/${FILE}
|
|
|
|
mv /tmp/${FILE} /usr/bin/docker-compose
|
|
|
|
rm /tmp/${FILE}.sha256
|
2016-07-01 01:37:22 +02:00
|
|
|
|
|
|
|
echo "... done"
|
|
|
|
|
|
|
|
/usr/bin/docker-compose version
|
2015-12-19 12:40:48 +01:00
|
|
|
}
|
|
|
|
|
2019-10-15 22:02:16 +02:00
|
|
|
install_nvidia() {
|
|
|
|
echo "Prepare install for NVIDIA proprietary display driver"
|
|
|
|
|
|
|
|
apt update
|
|
|
|
apt install -y \
|
|
|
|
gcc \
|
|
|
|
linux-source \
|
|
|
|
linux-headers-`uname -r` \
|
|
|
|
--no-install-recommends
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Please find a link to the current Package"
|
|
|
|
echo " https://devtalk.nvidia.com/default/topic/533434/linux/current-graphics-driver-releases/"
|
|
|
|
echo ""
|
|
|
|
echo "1. Download the self extracting archive. (*.run)"
|
|
|
|
echo "2. reboot into recovery mode and login as root"
|
|
|
|
echo "3. sh DRIVER_ARCHIVE.run"
|
|
|
|
echo ""
|
|
|
|
echo "... check if driver was installed correctly: $ nvidia-smi"
|
|
|
|
echo "more information can be found in README at link above"
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "Install NVIDIA-docker"
|
|
|
|
echo ""
|
|
|
|
echo "since Docker 19.03 no additional runtime required."
|
|
|
|
echo " https://github.com/NVIDIA/nvidia-docker"
|
|
|
|
|
|
|
|
# https://nvidia.github.io/nvidia-docker/
|
|
|
|
distribution="debian10"
|
|
|
|
|
|
|
|
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
|
|
|
|
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
|
|
|
|
apt update
|
|
|
|
apt install -y nvidia-container-toolkit
|
|
|
|
systemctl restart docker
|
|
|
|
docker pull nvidia/cuda:9.0-base
|
|
|
|
|
|
|
|
echo ""
|
|
|
|
echo "... check if driver was installed correctly: "
|
|
|
|
echo "$ docker run --gpus all nvidia/cuda:9.0-base nvidia-smi"
|
|
|
|
echo " should give same output as above"
|
|
|
|
}
|
|
|
|
|
2018-12-22 20:09:58 +01:00
|
|
|
install_virtualbox() {
|
|
|
|
# https://wiki.debian.org/VirtualBox#Installation_of_non-free_edition
|
2022-01-27 20:02:27 +01:00
|
|
|
$SUDO apt install -y \
|
2018-12-22 20:09:58 +01:00
|
|
|
apt-transport-https \
|
|
|
|
ca-certificates \
|
|
|
|
curl \
|
|
|
|
gnupg2 \
|
|
|
|
software-properties-common \
|
|
|
|
--no-install-recommends
|
|
|
|
|
2022-03-11 16:45:52 +01:00
|
|
|
curl -fsSL https://download.docker.com/linux/debian/gpg | $SUDO apt-key add -
|
|
|
|
|
|
|
|
# add docker apt repo
|
|
|
|
cat <<-EOF > /etc/apt/sources.list.d/docker.list
|
|
|
|
deb [arch=amd64] https://download.docker.com/linux/debian buster stable
|
|
|
|
# deb [arch=amd64] https://download.docker.com/linux/debian buster test
|
|
|
|
# deb [arch=amd64] https://download.docker.com/linux/debian buster nightly
|
|
|
|
EOF
|
|
|
|
|
2018-12-22 20:09:58 +01:00
|
|
|
}
|
|
|
|
|
2016-09-12 11:00:50 +02:00
|
|
|
# install/update golang from source
|
|
|
|
install_golang() {
|
2022-04-02 09:56:50 +02:00
|
|
|
export GO_VERSION=1.18
|
2016-09-12 11:00:50 +02:00
|
|
|
export GO_SRC=/usr/local/go
|
|
|
|
|
|
|
|
# if we are passing the version
|
|
|
|
if [[ ! -z "$1" ]]; then
|
|
|
|
export GO_VERSION=$1
|
|
|
|
fi
|
|
|
|
|
|
|
|
(
|
2018-10-23 18:22:03 +02:00
|
|
|
curl -sSL "https://storage.googleapis.com/golang/go${GO_VERSION}.linux-amd64.tar.gz" | $SUDO tar -v -C /usr/local -xz
|
2016-09-12 11:00:50 +02:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2021-10-30 10:08:00 +02:00
|
|
|
install_rust() {
|
2021-11-04 23:42:24 +01:00
|
|
|
echo "... rustup.sh ... "
|
|
|
|
curl --proto 'https' --tlsv1.2 https://sh.rustup.rs | sh
|
|
|
|
|
2022-04-02 09:56:50 +02:00
|
|
|
echo "... adding dependencies for alacritty and i3status-rs ... "
|
|
|
|
$SUDO apt install -y \
|
2021-11-04 23:42:24 +01:00
|
|
|
cmake \
|
|
|
|
fonts-font-awesome \
|
|
|
|
gcc \
|
|
|
|
pkg-config \
|
|
|
|
libdbus-1-dev \
|
|
|
|
libfreetype6-dev \
|
|
|
|
libfontconfig1-dev \
|
|
|
|
libssl-dev \
|
|
|
|
libxcb-xfixes0-dev \
|
|
|
|
libxkbcommon-dev \
|
|
|
|
python3 \
|
|
|
|
--no-install-recommends
|
|
|
|
|
|
|
|
cargo install du-dust
|
|
|
|
|
|
|
|
(
|
|
|
|
mkdir -p "/home/$USERNAME/projects"
|
|
|
|
TARGET="/home/$USERNAME/projects/i3status-rust"
|
|
|
|
git clone https://github.com/greshake/i3status-rust ${TARGET}
|
|
|
|
cd ${TARGET}
|
|
|
|
cargo install --path .
|
|
|
|
./install.sh
|
|
|
|
)
|
2021-10-30 10:08:00 +02:00
|
|
|
}
|
|
|
|
|
2015-12-19 12:40:48 +01:00
|
|
|
main() {
|
2016-07-01 01:37:22 +02:00
|
|
|
local cmd=$1
|
2015-12-19 12:40:48 +01:00
|
|
|
|
2016-07-01 01:37:22 +02:00
|
|
|
if [[ -z "$cmd" ]]; then
|
2021-11-04 23:42:24 +01:00
|
|
|
echo "Usage: \n base (incl docker+compose)| i3 | sway | server | latex | update-docker | vscode | go | rust"
|
2017-01-04 23:44:35 +01:00
|
|
|
fi
|
|
|
|
|
2018-06-02 17:17:16 +02:00
|
|
|
case "$cmd" in
|
|
|
|
base)
|
|
|
|
base_applications
|
2021-11-04 23:42:24 +01:00
|
|
|
install_docker
|
|
|
|
install_compose
|
2018-06-02 17:17:16 +02:00
|
|
|
;;
|
|
|
|
server)
|
2019-10-15 22:02:16 +02:00
|
|
|
base_applications
|
2018-06-02 17:17:16 +02:00
|
|
|
install_server_base
|
2019-10-15 22:02:16 +02:00
|
|
|
install_docker
|
|
|
|
install_compose
|
2018-06-02 17:17:16 +02:00
|
|
|
;;
|
2021-11-04 23:42:24 +01:00
|
|
|
i3)
|
2019-10-15 20:36:22 +02:00
|
|
|
base_applications
|
2021-10-30 10:08:00 +02:00
|
|
|
install_syncthing
|
2018-06-02 17:17:16 +02:00
|
|
|
install_i3
|
2021-10-30 10:08:00 +02:00
|
|
|
install_workstation_apps
|
2021-11-04 23:42:24 +01:00
|
|
|
;;
|
|
|
|
sway)
|
|
|
|
base_applications
|
|
|
|
install_syncthing
|
|
|
|
install_sway
|
|
|
|
install_workstation_apps
|
2018-06-02 17:17:16 +02:00
|
|
|
;;
|
2019-10-15 22:02:16 +02:00
|
|
|
links)
|
|
|
|
link_userdirs /mnt/docs/
|
|
|
|
;;
|
2019-01-14 23:28:37 +01:00
|
|
|
latex)
|
|
|
|
install_latex
|
|
|
|
;;
|
2019-10-15 20:36:22 +02:00
|
|
|
vscode)
|
|
|
|
install_vscodium
|
|
|
|
;;
|
2018-06-02 17:17:16 +02:00
|
|
|
update-docker)
|
2019-10-15 20:36:22 +02:00
|
|
|
install_docker
|
2018-06-02 17:17:16 +02:00
|
|
|
install_compose
|
|
|
|
;;
|
|
|
|
go)
|
|
|
|
install_golang
|
|
|
|
;;
|
2021-10-30 10:08:00 +02:00
|
|
|
rust)
|
|
|
|
install_rust
|
|
|
|
;;
|
2021-12-02 12:21:25 +01:00
|
|
|
wine)
|
|
|
|
install_wine
|
|
|
|
;;
|
2018-06-02 17:17:16 +02:00
|
|
|
esac
|
2015-12-19 12:40:48 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
main "$@"
|