Files
linux-scripts/setup-distrobox.sh
Lightemerald 9088b88826 Setup improvement and fixes
- Added more user interaction in setup-linux
- Added GPU setup
- Added warnings
- Fixed nvidia on setup-distrobox
- Better support of both fedora and fedora rawhide (repo)
2023-08-26 01:12:08 +02:00

60 lines
4.7 KiB
Bash

#!/bin/bash
if (whiptail --title "Distrobox" --yesno "Should we install Distrobox and Podman?" 8 78); then
if [[ $DISTRO =~ (debian|ubuntu) ]]; then
sudo apt install distrobox podman -y
elif [[ $DISTRO == "fedora" ]]; then
sudo dnf in distrobox podman -y
elif [[ $DISTRO == "arch" ]]; then
sudo pacman -S --needed distrobox podman --noconfirm
fi
if (whiptail --title "Container" --yesno "Should we install all containers?" 8 78); then
echo No | distrobox rm arch --force
if lspci | grep -i nvidia &>/dev/null; then
distrobox-create --yes --name arch \
--image docker.io/library/archlinux:latest --init --pull --nvidia \
--home /home/"$USER"/distrobox/arch \
--pre-init-hooks "pacman -Sy --needed base-devel sudo git zsh nano wget curl unzip --noconfirm" \
--init-hooks "curl -sSL https://blackarch.org/strap.sh | sudo bash && sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com && sudo pacman-key --lsign-key 3056513887B78AEB && sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' --noconfirm && echo -e '[chaotic-aur]' | sudo tee -a /etc/pacman.conf && echo -e 'Include = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf && sudo pacman -Sy --needed fastfetch yay --noconfirm" \
--additional-packages "systemd"
else
distrobox-create --yes --name arch \
--image docker.io/library/archlinux:latest --init --pull \
--home /home/"$USER"/distrobox/arch \
--pre-init-hooks "pacman -Sy --needed base-devel sudo git zsh nano wget curl unzip --noconfirm" \
--init-hooks "curl -sSL https://blackarch.org/strap.sh | sudo bash && sudo pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com && sudo pacman-key --lsign-key 3056513887B78AEB && sudo pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst' 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst' --noconfirm && echo -e '[chaotic-aur]' | sudo tee -a /etc/pacman.conf && echo -e 'Include = /etc/pacman.d/chaotic-mirrorlist' | sudo tee -a /etc/pacman.conf && sudo pacman -Sy --needed fastfetch yay --noconfirm" \
--additional-packages "systemd"
fi
echo No | distrobox rm debian --force
if lspci | grep -i nvidia &>/dev/null; then
distrobox-create --yes --name debian \
--image docker.io/library/debian:testing --init --pull --nvidia \
--home /home/"$USER"/distrobox/debian \
--init-hooks "sudo apt update && sudo apt upgrade -y && wget -O ~/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/download/1.12.2/fastfetch-1.12.2-Linux.deb && sudo dpkg -i ~/fastfetch.deb && rm -f ~/fastfetch.deb" \
--additional-packages "sudo systemd git zsh iproute2 nano wget curl unzip"
else
distrobox-create --yes --name debian \
--image docker.io/library/debian:testing --init --pull \
--home /home/"$USER"/distrobox/debian \
--init-hooks "sudo apt update && sudo apt upgrade -y && wget -O ~/fastfetch.deb https://github.com/fastfetch-cli/fastfetch/releases/download/1.12.2/fastfetch-1.12.2-Linux.deb && sudo dpkg -i ~/fastfetch.deb && rm -f ~/fastfetch.deb" \
--additional-packages "sudo systemd git zsh iproute2 nano wget curl unzip"
fi
echo No | distrobox rm fedora-rawhide --force
if lspci | grep -i nvidia &>/dev/null; then
distrobox-create --yes --name fedora-rawhide \
--image registry.fedoraproject.org/fedora:rawhide --init --pull --nvidia \
--home /home/"$USER"/distrobox/fedora-rawhide \
--init-hooks "sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y" \
--additional-packages "sudo systemd git zsh fastfetch nano wget curl unzip"
else
distrobox-create --yes --name fedora-rawhide \
--image registry.fedoraproject.org/fedora:rawhide --init --pull \
--home /home/"$USER"/distrobox/fedora-rawhide \
--init-hooks "sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm -y" \
--additional-packages "sudo systemd git zsh fastfetch nano wget curl unzip"
fi
fi
fi