fix(install-script): FreeBSD fixes and more

- Alias: FreeBSD: pkg update and autoremove aliases added
- Install: GhostBSD: Use FreeBSD commands to do the installation
- Install: FreeBSD: start dbus
- Install: Fedora: improve dnf install speed by limiting minimum
  download rate & decreasing timeout
- Install: Brew: Don't install brew package if OS has installed the package
- Install: Brew: sccache for Rust
- Install: OS: More packages moved from brew -> OS. Those are available
  across FreeBSD & Fedora
This commit is contained in:
Pratik Tripathy
2025-01-06 17:39:05 +05:30
parent 35b0e34cfd
commit 27b1f7e9ed
7 changed files with 50 additions and 22 deletions

View File

@@ -11,7 +11,7 @@ That is, changes on repository get auto reflected on the system.
```bash ```bash
$ git clone https://github.com/pratiktri/dotfiles $ git clone https://github.com/pratiktri/dotfiles
$ bash setup.sh -h $ sh setup.sh -h
Apply all settings stored in the script's directory to your home directory. Apply all settings stored in the script's directory to your home directory.
Usage: ./setup.sh [OPTION] Usage: ./setup.sh [OPTION]

View File

@@ -21,6 +21,8 @@ up(){
update_command="sudo pkcon refresh && sudo pkcon update && sudo apt dist-upgrade && sudo apt autoremove" update_command="sudo pkcon refresh && sudo pkcon update && sudo apt dist-upgrade && sudo apt autoremove"
elif command -v apt-get > /dev/null 2>&1; then elif command -v apt-get > /dev/null 2>&1; then
update_command="sudo apt-get update && sudo apt-get upgrade && sudo apt dist-upgrade && sudo apt autoremove" update_command="sudo apt-get update && sudo apt-get upgrade && sudo apt dist-upgrade && sudo apt autoremove"
elif command -v pkg > /dev/null 2>&1; then
update_command="sudo pkg update && sudo pkg upgrade && sudo pkg autoremove"
fi fi
eval "$update_command" eval "$update_command"
@@ -38,6 +40,8 @@ autorem(){
remove_command="sudo apt autoremove" remove_command="sudo apt autoremove"
elif command -v dnf > /dev/null 2>&1; then elif command -v dnf > /dev/null 2>&1; then
remove_command="sudo dnf autoremove" remove_command="sudo dnf autoremove"
elif command -v pkg > /dev/null 2>&1; then
remove_command="sudo pkg autoremove"
fi fi
eval "$remove_command" eval "$remove_command"

View File

@@ -29,10 +29,14 @@ install_brew_packages() {
\#*) continue ;; \#*) continue ;;
esac esac
# Check if the package exists in the Homebrew repository # Check if package exists in brew repository and is not already installed on the system
if brew search "$brew_package" 2>/dev/null | grep -q "$brew_package"; then if brew search "$brew_package" 2>/dev/null | grep -q "$brew_package"; then
echo "Available: $brew_package" if ! command -v "$brew_package" >/dev/null 2>&1; then
found_packages="$found_packages $brew_package" echo "Available: $brew_package"
found_packages="$found_packages $brew_package"
else
echo "Already installed: $brew_package"
fi
else else
not_found_packages="$not_found_packages $brew_package" not_found_packages="$not_found_packages $brew_package"
echo "Unavailable: $brew_package" echo "Unavailable: $brew_package"
@@ -59,7 +63,6 @@ main() {
input_file_check input_file_check
install_brew install_brew
install_brew_packages install_brew_packages
print_summary "Brew" "$not_found_packages" print_summary "Brew" "$not_found_packages"
} }

View File

@@ -26,7 +26,7 @@ setup() {
OS_PKG_CHECK_COMMAND="dnf list available" OS_PKG_CHECK_COMMAND="dnf list available"
dnf_setup dnf_setup
;; ;;
"freebsd") "freebsd" | "ghostbsd")
OS_INSTALL_COMMAND="pkg install -y" OS_INSTALL_COMMAND="pkg install -y"
OS_PKG_CHECK_COMMAND="pkg search" OS_PKG_CHECK_COMMAND="pkg search"
freebsd_setup freebsd_setup
@@ -43,7 +43,8 @@ freebsd_setup() {
sudo pkg update && sudo pkg upgrade sudo pkg update && sudo pkg upgrade
# Install KDE WM # Install KDE WM
sudo pkg install -y xorg kde5 sddm nvidia-driver sudo pkg install -y xorg sddm nvidia-driver
sudo pkg install -y kde5 plasma5-sddm-kcm plasma5-nm
# Add current user to video & wheel group # Add current user to video & wheel group
sudo pw groupmod video -m "$(whoami)" sudo pw groupmod video -m "$(whoami)"
@@ -55,6 +56,7 @@ freebsd_setup() {
# Enable services that will be needed # Enable services that will be needed
sudo sysrc dbus_enable="YES" sudo sysrc dbus_enable="YES"
sudo sysrc sddm_enable="YES" sudo sysrc sddm_enable="YES"
sudo service dbus start
sudo sysctl net.local.stream.recvspace=65535 sudo sysctl net.local.stream.recvspace=65535
sudo sysctl net.local.stream.sendspace=65535 sudo sysctl net.local.stream.sendspace=65535
@@ -68,6 +70,8 @@ dnf_setup() {
echo "max_parallel_downloads=10" | sudo tee -a /etc/dnf/dnf.conf >/dev/null echo "max_parallel_downloads=10" | sudo tee -a /etc/dnf/dnf.conf >/dev/null
echo "defaultYes=True" | sudo tee -a /etc/dnf/dnf.conf >/dev/null echo "defaultYes=True" | sudo tee -a /etc/dnf/dnf.conf >/dev/null
echo "keepcache=True" | sudo tee -a /etc/dnf/dnf.conf >/dev/null echo "keepcache=True" | sudo tee -a /etc/dnf/dnf.conf >/dev/null
echo "minrate=40k" | sudo tee -a /etc/dnf/dnf.conf >/dev/null
echo "timeout=20" | sudo tee -a /etc/dnf/dnf.conf >/dev/null
# Enable RPM Fusion & Install media codecs # Enable RPM Fusion & Install media codecs
sudo dnf install -y 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 && sudo dnf groupupdate -y core multimedia --setop="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin sound-and-video && sudo dnf makecache sudo dnf install -y 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 && sudo dnf groupupdate -y core multimedia --setop="install_weak_deps=False" --exclude=PackageKit-gstreamer-plugin sound-and-video && sudo dnf makecache

View File

@@ -17,7 +17,7 @@ rustlang() {
manual_installs() { manual_installs() {
if [ "$(uname -s)" != "FreeBSD" ]; then if [ "$(uname -s)" != "FreeBSD" ]; then
kitty_term kitty_term
fi fi
rustlang rustlang
} }

View File

@@ -20,6 +20,7 @@ neovim
prettierd prettierd
python@3.12 python@3.12
rclone rclone
sccache
shellcheck shellcheck
shodan shodan
speedtest-cli speedtest-cli

View File

@@ -5,18 +5,22 @@ apt-transport-https
build-essential build-essential
libreadline-dev libreadline-dev
libavcodec-extra libavcodec-extra
nvidia-driver
# Below few are dnf-only packages # Below few are dnf-specific packages
akmod-nvidia akmod-nvidia
dnf-plugins-core dnf-plugins-core
libva-nvidia-driver libva-nvidia-driver
xorg-x11-drv-nvidia-cuda xorg-x11-drv-nvidia-cuda
# Common # Common
aspnetcore-runtime-8.0 aspnetcore-runtime-8.0
bash bash
bat
bleachbit bleachbit
brave-browser brave-browser
btop
cmake cmake
code
containerd.io containerd.io
curl curl
docker-buildx-plugin docker-buildx-plugin
@@ -29,19 +33,27 @@ dotnet-runtime-8.0
dotnet-sdk-8.0 dotnet-sdk-8.0
evolution-ews evolution-ews
evolution-mapi evolution-mapi
fd-find
ffmpeg ffmpeg
flameshot flameshot
flatpak flatpak
fzf
gcc gcc
gdb gdb
git git
gitleaks
gnupg gnupg
go go
gparted gparted
grub-customizer grub-customizer
hadolint
htop htop
inxi
jq
kitty
kde-spectacle kde-spectacle
kitty-terminfo kitty-terminfo
libreoffice
llvm llvm
lua5.3 lua5.3
luajit luajit
@@ -50,17 +62,25 @@ neovim
net-tools net-tools
node node
npm npm
nvidia-driver
nvidia-settings
openssh-client openssh-client
python3 python3
python3-pip python3-pip
podman
qbittorrent qbittorrent
rclone
ripgrep ripgrep
sccache
ShellCheck
simplescreenrecorder simplescreenrecorder
smplayer smplayer
software-properties-common software-properties-common
solaar solaar
syncthing syncthing
tmux tmux
tokei
tree-sitter-cli
ufw ufw
ulauncher ulauncher
vim vim
@@ -68,27 +88,23 @@ vlc
vulkan-tools vulkan-tools
wget wget
xclip xclip
yt-dlp
zoxide
zsh zsh
# FreeBSD packages # FreeBSD packages
bat codespell
fd-find dotnet
fzf html
fusefs-lkl
firefox-esr firefox-esr
gitleaks gitleaks
jq
kitty
lazygit
libreoffice
lua54 lua54
podman shfmt
rclone
sqlite sqlite
tokei stylua
tree-sitter tree-sitter
vscode vscode
yt-dlp
zoxide
# Conflicts on FreeBSD # Conflicts on FreeBSD
ca-certificates ca-certificates