mirror of
https://codeberg.org/hyperreal/dotfiles
synced 2024-11-25 11:53:43 +01:00
Compare commits
No commits in common. "8addafd4b90f60cd20417ae6381ebb5fb687132f" and "76ceb8fc8ce18ba01ba17df8bf3f77fd5f6381a2" have entirely different histories.
8addafd4b9
...
76ceb8fc8c
194
install.sh
194
install.sh
@ -4,61 +4,8 @@ set -euo pipefail
|
|||||||
|
|
||||||
GREEN='\033[1;32m'
|
GREEN='\033[1;32m'
|
||||||
NC='\033[0m'
|
NC='\033[0m'
|
||||||
apt_packages=(
|
|
||||||
atop
|
|
||||||
autossh
|
|
||||||
bat
|
|
||||||
borgbackup
|
|
||||||
borgmatic
|
|
||||||
build-essential
|
|
||||||
calibre
|
|
||||||
cmake
|
|
||||||
curl
|
|
||||||
direnv
|
|
||||||
duf
|
|
||||||
emacs
|
|
||||||
firewalld
|
|
||||||
fzf
|
|
||||||
git
|
|
||||||
git-core
|
|
||||||
golang
|
|
||||||
hdparm
|
|
||||||
htop
|
|
||||||
hugo
|
|
||||||
jc
|
|
||||||
jq
|
|
||||||
lsd
|
|
||||||
lynx
|
|
||||||
neovim
|
|
||||||
nmap
|
|
||||||
nodejs
|
|
||||||
npm
|
|
||||||
papirus-icon-theme
|
|
||||||
parallel
|
|
||||||
pipx
|
|
||||||
prometheus-node-exporter
|
|
||||||
python3-dev
|
|
||||||
python3-pip
|
|
||||||
python3-poetry
|
|
||||||
ripgrep
|
|
||||||
rsync
|
|
||||||
rsyslog
|
|
||||||
shfmt
|
|
||||||
shellcheck
|
|
||||||
tcpdump
|
|
||||||
tealdeer
|
|
||||||
trash-cli
|
|
||||||
unzip
|
|
||||||
w3m
|
|
||||||
wget
|
|
||||||
wireshark
|
|
||||||
wl-clipboard
|
|
||||||
xfce4-terminal
|
|
||||||
zip
|
|
||||||
zsh
|
|
||||||
)
|
|
||||||
|
|
||||||
dnf_packages=(
|
packages=(
|
||||||
age
|
age
|
||||||
atop
|
atop
|
||||||
autossh
|
autossh
|
||||||
@ -92,7 +39,6 @@ dnf_packages=(
|
|||||||
lagrange
|
lagrange
|
||||||
ldns
|
ldns
|
||||||
libtool
|
libtool
|
||||||
lsd
|
|
||||||
lsof
|
lsof
|
||||||
lynx
|
lynx
|
||||||
neochat
|
neochat
|
||||||
@ -116,6 +62,7 @@ dnf_packages=(
|
|||||||
tealdeer
|
tealdeer
|
||||||
tokodon
|
tokodon
|
||||||
trash-cli
|
trash-cli
|
||||||
|
uv
|
||||||
vlc
|
vlc
|
||||||
w3m
|
w3m
|
||||||
wireshark
|
wireshark
|
||||||
@ -142,16 +89,15 @@ pipx_packages=(
|
|||||||
"bpython"
|
"bpython"
|
||||||
"isort"
|
"isort"
|
||||||
"pyright"
|
"pyright"
|
||||||
"uv"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
services_enable=(
|
services_enable=(
|
||||||
atop.service
|
atop.service
|
||||||
atopacct.service
|
atopacct.service
|
||||||
atop-rotate.timer
|
atop-rotate.timer
|
||||||
firewalld.service
|
|
||||||
prometheus-node-exporter.service
|
prometheus-node-exporter.service
|
||||||
rsyslog.service
|
rsyslog.service
|
||||||
|
sshd.service
|
||||||
systemd-networkd
|
systemd-networkd
|
||||||
tailscaled.service
|
tailscaled.service
|
||||||
)
|
)
|
||||||
@ -163,6 +109,8 @@ services_disable=(
|
|||||||
cups.service
|
cups.service
|
||||||
cups-browsed.service
|
cups-browsed.service
|
||||||
NetworkManager.service
|
NetworkManager.service
|
||||||
|
sddm.service
|
||||||
|
wpa_supplicant.service
|
||||||
)
|
)
|
||||||
|
|
||||||
function action_label() {
|
function action_label() {
|
||||||
@ -170,38 +118,9 @@ function action_label() {
|
|||||||
echo -e "${GREEN}--> ${1}...${NC}"
|
echo -e "${GREEN}--> ${1}...${NC}"
|
||||||
}
|
}
|
||||||
|
|
||||||
install_makedeb_prebuilt_packages() {
|
|
||||||
wget -qO - 'https://proget.makedeb.org/debian-feeds/prebuilt-mpr.pub' | gpg --dearmor | sudo tee /usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg 1>/dev/null
|
|
||||||
echo "deb [arch=all,$(dpkg --print-architecture) signed-by=/usr/share/keyrings/prebuilt-mpr-archive-keyring.gpg] https://proget.makedeb.org prebuilt-mpr $(lsb_release -cs)" | sudo tee /etc/apt/sources.list.d/prebuilt-mpr.list
|
|
||||||
sudo apt update
|
|
||||||
sudo apt dist-upgrade -y
|
|
||||||
sudo apt install just
|
|
||||||
}
|
|
||||||
|
|
||||||
# interactive
|
|
||||||
install_starship() {
|
|
||||||
if ! test -f "$(command -v starship)"; then
|
|
||||||
curl -sS https://starship.rs/install.sh | sh
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function install_packages() {
|
function install_packages() {
|
||||||
action_label "INSTALLING PACKAGES"
|
action_label "INSTALLING PACKAGES"
|
||||||
if test -f /etc/debian_version; then
|
sudo dnf install -y "${packages[@]}"
|
||||||
sudo apt install -y "${apt_packages[@]}"
|
|
||||||
install_makedeb_prebuilt_packages
|
|
||||||
install_starship
|
|
||||||
install_zellij
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -f /etc/redhat-release; then
|
|
||||||
sudo dnf install -y "${dnf_packages[@]}"
|
|
||||||
install_devel_groups
|
|
||||||
enable_copr_repos
|
|
||||||
install_copr_packages
|
|
||||||
install_rpmfusion_repos
|
|
||||||
install_rpmfusion_packages
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_devel_groups() {
|
function install_devel_groups() {
|
||||||
@ -230,42 +149,16 @@ function install_rpmfusion_packages() {
|
|||||||
sudo dnf install -y --allowerasing ffmpeg-libs
|
sudo dnf install -y --allowerasing ffmpeg-libs
|
||||||
}
|
}
|
||||||
|
|
||||||
install_zellij() {
|
|
||||||
if test -f /etc/debian_version; then
|
|
||||||
curl -s https://api.github.com/repos/zellij-org/zellij/releases/latest | grep "browser_download_url" | grep "zellij-$(uname -m)-unknown-linux-musl.tar.gz" | cut -d : -f 2,3 | tr -d '"' | wget -qi -
|
|
||||||
curl -s https://api.github.com/repos/zellij-org/zellij/releases/latest | grep "browser_download_url" | grep "zellij-$(uname -m)-unknown-linux-musl.sha256sum" | cut -d : -f 2,3 | tr -d '"' | wget -qi -
|
|
||||||
tar xvf "zellij-$(uname -m)-unknown-linux-musl.tar.gz"
|
|
||||||
if [ $(sha256sum -c "zellij-$(uname -m)-unknown-linux-musl.sha256sum" | head -n 1 | awk '{print $2}') = "OK" ]; then
|
|
||||||
sudo mv zellij /usr/local/bin
|
|
||||||
fi
|
|
||||||
rm -v zellij*
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
function install_charm_packages() {
|
function install_charm_packages() {
|
||||||
action_label "INSTALLING CHARM PACKAGES"
|
action_label "INSTALLING CHARM PACKAGES"
|
||||||
|
|
||||||
if test -f /etc/debian_version; then
|
|
||||||
curl -s https://api.github.com/repos/charmbracelet/gum/releases/latest | grep "browser_download_url.*deb" | grep "$(dpkg --print-architecture)" | cut -d : -f 2,3 | tr -d '"' | wget -qi -
|
|
||||||
curl -s https://api.github.com/repos/charmbracelet/gum/releases/latest | grep "browser_download_url" | grep "checksums.txt" | head -n 1 | cut -d : -f 2,3 | tr -d '"' | wget -qi -
|
|
||||||
if [ $(grep "$(dpkg --print-architecture).deb" checksums.txt | sha256sum -c | head -n 1 | awk '{print $2}') = "OK" ]; then
|
|
||||||
sudo dpkg -i gum*.deb
|
|
||||||
sudo apt -f install
|
|
||||||
fi
|
|
||||||
rm -v gum*
|
|
||||||
rm -v checksums.txt
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -f /etc/redhat-release; then
|
|
||||||
echo '[charm]
|
echo '[charm]
|
||||||
name=Charm
|
name=Charm
|
||||||
baseurl=https://repo.charm.sh/yum/
|
baseurl=https://repo.charm.sh/yum/
|
||||||
enabled=1
|
enabled=1
|
||||||
gpgcheck=1
|
gpgcheck=1
|
||||||
gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo
|
gpgkey=https://repo.charm.sh/yum/gpg.key' | sudo tee /etc/yum.repos.d/charm.repo
|
||||||
sudo rpm --import https://repo.charm.sh/yum/gpg.key
|
sudo rpm --import https://repo.charm.sh/yum/gpg.key
|
||||||
sudo dnf install -y gum charm
|
sudo dnf install -y gum charm
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function install_tailscale() {
|
function install_tailscale() {
|
||||||
@ -325,11 +218,7 @@ function setup_rsyslog_conf() {
|
|||||||
# After: setup_networkd_conf
|
# After: setup_networkd_conf
|
||||||
function disable_services() {
|
function disable_services() {
|
||||||
action_label "DISABLING SYSTEMD SERVICES"
|
action_label "DISABLING SYSTEMD SERVICES"
|
||||||
for service in "${services_disable[@]}"; do
|
for service in "${services_disable[@]}"; do sudo systemctl disable --now "$service"; done
|
||||||
if sudo systemctl is-active "$service"; then
|
|
||||||
sudo systemctl disable --now "$service"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# After:
|
# After:
|
||||||
@ -338,38 +227,20 @@ function disable_services() {
|
|||||||
function enable_services() {
|
function enable_services() {
|
||||||
action_label "ENABLING SYSTEMD SERVICES"
|
action_label "ENABLING SYSTEMD SERVICES"
|
||||||
for service in "${services_enable[@]}"; do sudo systemctl enable --now "$service"; done
|
for service in "${services_enable[@]}"; do sudo systemctl enable --now "$service"; done
|
||||||
if test -f /etc/debian_version; then
|
|
||||||
sudo systemctl enable --now ssh.service
|
|
||||||
elif test -f /etc/redhat-release; then
|
|
||||||
sudo systemctl enable --now sshd.service
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function disable_ipv6() {
|
function disable_ipv6() {
|
||||||
action_label "DISABLING IPV6"
|
action_label "DISABLING IPV6"
|
||||||
if test -f /etc/debian_version; then
|
|
||||||
if ! grep "net.ipv6.conf.all.disable_ipv6" /etc/sysctl.conf; then
|
|
||||||
echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
|
|
||||||
echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
|
|
||||||
echo "net.ipv6.conf.lo.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf
|
|
||||||
sudo sysctl -p
|
|
||||||
else
|
|
||||||
echo "IPv6 already disabled."
|
|
||||||
fi
|
|
||||||
elif test -f /etc/redhat-release; then
|
|
||||||
if ! sudo grep "ipv6.disable=1" /boot/grub2/grub.cfg; then
|
if ! sudo grep "ipv6.disable=1" /boot/grub2/grub.cfg; then
|
||||||
sudo grubby --args=ipv6.disable=1 --update-kernel=ALL
|
sudo grubby --args=ipv6.disable=1 --update-kernel=ALL
|
||||||
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
|
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
|
||||||
else
|
else
|
||||||
echo "IPv6 already disabled."
|
echo "IPv6 already disabled."
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setup_fstab() {
|
function setup_fstab() {
|
||||||
action_label "SETTING UP /etc/fstab"
|
action_label "SETTING UP /etc/fstab"
|
||||||
|
|
||||||
if test -f /etc/redhat-release; then
|
|
||||||
sudo mkdir -p /mnt/borgbackup /mnt/quick-backup
|
sudo mkdir -p /mnt/borgbackup /mnt/quick-backup
|
||||||
if ! grep "ecf44876-2e4e-46ad-9f12-fc516c8ace2d" /etc/fstab; then
|
if ! grep "ecf44876-2e4e-46ad-9f12-fc516c8ace2d" /etc/fstab; then
|
||||||
echo "UUID=ecf44876-2e4e-46ad-9f12-fc516c8ace2d /mnt/borgbackup btrfs defaults,subvol=@borgbackup,compress=zstd:1,x-systemd.device-timeout=20 0 0" | sudo tee -a /etc/fstab
|
echo "UUID=ecf44876-2e4e-46ad-9f12-fc516c8ace2d /mnt/borgbackup btrfs defaults,subvol=@borgbackup,compress=zstd:1,x-systemd.device-timeout=20 0 0" | sudo tee -a /etc/fstab
|
||||||
@ -381,7 +252,6 @@ function setup_fstab() {
|
|||||||
sudo restorecon -Rv /mnt/borgbackup
|
sudo restorecon -Rv /mnt/borgbackup
|
||||||
sudo restorecon -Rv /mnt/quick-backup
|
sudo restorecon -Rv /mnt/quick-backup
|
||||||
sudo mount -av
|
sudo mount -av
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Depends:
|
# Depends:
|
||||||
@ -389,10 +259,8 @@ function setup_fstab() {
|
|||||||
# - setup_fstab
|
# - setup_fstab
|
||||||
function setup_borgmatic_config() {
|
function setup_borgmatic_config() {
|
||||||
action_label "SETTING UP BORGMATIC CONFIG"
|
action_label "SETTING UP BORGMATIC CONFIG"
|
||||||
if test -f /etc/redhat-release; then
|
|
||||||
sudo mkdir -p /etc/borgmatic
|
sudo mkdir -p /etc/borgmatic
|
||||||
sudo cp -v /mnt/quick-backup/borgmatic-config.yaml /etc/borgmatic/config.yaml
|
sudo cp -v /mnt/quick-backup/borgmatic-config.yaml /etc/borgmatic/config.yaml
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Depends:
|
# Depends:
|
||||||
@ -400,19 +268,13 @@ function setup_borgmatic_config() {
|
|||||||
# - setup_fstab
|
# - setup_fstab
|
||||||
function copy_quick_backup() {
|
function copy_quick_backup() {
|
||||||
action_label "COPYING QUICK BACKUP"
|
action_label "COPYING QUICK BACKUP"
|
||||||
if test -f /etc/redhat-release; then
|
|
||||||
rsync -aAXPz /mnt/quick-backup/jas/ /home/jas
|
rsync -aAXPz /mnt/quick-backup/jas/ /home/jas
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Depends: copy_quick_backup
|
# Depends: copy_quick_backup
|
||||||
function build_bat_cache() {
|
function build_bat_cache() {
|
||||||
action_label "BUILDING BAT CACHE"
|
action_label "BUILDING BAT CACHE"
|
||||||
if test -f /etc/debian_version; then
|
|
||||||
batcat cache --build
|
|
||||||
elif test -f /etc/redhat-release; then
|
|
||||||
bat cache --build
|
bat cache --build
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Depends: install_packages
|
# Depends: install_packages
|
||||||
@ -433,11 +295,7 @@ function setup_firewalld() {
|
|||||||
else
|
else
|
||||||
echo "firewalld tailnet zone already configured"
|
echo "firewalld tailnet zone already configured"
|
||||||
fi
|
fi
|
||||||
if test -f /etc/debian_version; then
|
|
||||||
sudo firewall-cmd --permanent --zone=public --remove-service={dhcpv6-client,samba-client}
|
|
||||||
elif test -f /etc/redhat-release; then
|
|
||||||
sudo firewall-cmd --permanent --zone=FedoraWorkstation --remove-service={dhcpv6-client,samba-client}
|
sudo firewall-cmd --permanent --zone=FedoraWorkstation --remove-service={dhcpv6-client,samba-client}
|
||||||
fi
|
|
||||||
sudo firewall-cmd --reload
|
sudo firewall-cmd --reload
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -447,28 +305,36 @@ function install_rclone() {
|
|||||||
command -v rclone
|
command -v rclone
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Depends: install_rclone copy_quick_backup
|
||||||
|
function enable_sync_to_remotes() {
|
||||||
|
action_label "ENABLING sync_to_remotes.timer"
|
||||||
|
systemctl --user enable --now sync_to_remotes.timer
|
||||||
|
}
|
||||||
|
|
||||||
install_packages
|
install_packages
|
||||||
|
install_devel_groups
|
||||||
|
enable_copr_repos
|
||||||
|
install_copr_packages
|
||||||
|
install_rpmfusion_repos
|
||||||
|
install_rpmfusion_packages
|
||||||
install_charm_packages
|
install_charm_packages
|
||||||
install_tailscale
|
install_tailscale
|
||||||
|
enable_flathub
|
||||||
if test -f /etc/redhat-release; then
|
install_flatpaks
|
||||||
enable_flathub
|
|
||||||
install_flatpaks
|
|
||||||
setup_networkd_conf
|
|
||||||
setup_fstab
|
|
||||||
setup_borgmatic_config
|
|
||||||
copy_quick_backup
|
|
||||||
fi
|
|
||||||
|
|
||||||
install_pipx_packages
|
install_pipx_packages
|
||||||
|
setup_networkd_conf
|
||||||
setup_resolv_conf
|
setup_resolv_conf
|
||||||
setup_rsyslog_conf
|
setup_rsyslog_conf
|
||||||
disable_services
|
disable_services
|
||||||
enable_services
|
enable_services
|
||||||
disable_ipv6
|
disable_ipv6
|
||||||
|
setup_fstab
|
||||||
|
setup_borgmatic_config
|
||||||
|
copy_quick_backup
|
||||||
build_bat_cache
|
build_bat_cache
|
||||||
update_tealdeer_cache
|
update_tealdeer_cache
|
||||||
setup_firewalld
|
setup_firewalld
|
||||||
install_rclone
|
install_rclone
|
||||||
|
enable_sync_to_remotes
|
||||||
|
|
||||||
action_label "DONE SETTING UP ALL THE THINGS ^_^"
|
action_label "DONE SETTING UP ALL THE THINGS ^_^"
|
||||||
|
Loading…
Reference in New Issue
Block a user