dotfiles/install_utils
2025-11-23 13:59:03 -05:00

79 lines
1.6 KiB
Fish
Executable file

#!/usr/bin/env fish
function log -a message
echo \n"--- $message ---"\n
end
read -P "OS? (arch/debian/fedora/mac) " -l distro
set -l base_pkgs \
fish \
git \
neovim \
tmux \
rsync \
curl \
less \
fzf \
mosh \
lsd \
ripgrep \
bat \
tree-sitter-cli \
nodejs \
zoxide \
git-delta
set -l mac_pkgs \
$base_pkgs \
fd \
yazi
set -l arch_pkgs \
$base_pkgs \
fd \
yazi
set -l debian_pkgs \
$base_pkgs \
fd-find
set -l fedora_pkgs \
$base_pkgs \
fd-find
switch $distro
case mac
log 'Installing packages with Homebrew'
brew install $mac_pkgs
case arch
log 'Installing paru'
sudo pacman --sync --needed --noconfirm base-devel
or return $status
set -l cwd (pwd)
and set -l tmp_dir (mktemp --directory)
or return $status
git clone https://aur.archlinux.org/paru.git $tmp_dir
and cd $tmp_dir
and makepkg --syncdeps --install --noconfirm
and cd $cwd
or return $status
log 'Installing packages with paru'
paru --sync --refresh --sysupgrade --noconfirm
and paru --sync --noconfirm $arch_pkgs
case debian
log 'Installing packages with APT'
sudo apt-get --quiet --yes update
and sudo apt-get --quiet --yes upgrade
and sudo apt-get --quiet --yes install $debian_pkgs
case fedora
log 'Installing packages with DNF'
sudo dnf upgrade --assumeyes
and sudo dnf --assumeyes install $fedora_pkgs
end