50 lines
1.2 KiB
Bash
Executable File
50 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
DOTFILES="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
# --- package manager detection ---
|
|
|
|
install_packages() {
|
|
if command -v pacman &>/dev/null; then
|
|
sudo pacman -S --needed "$@"
|
|
elif command -v apt &>/dev/null; then
|
|
sudo apt install -y "$@"
|
|
elif command -v dnf &>/dev/null; then
|
|
sudo dnf install -y "$@"
|
|
else
|
|
echo "No supported package manager found (pacman/apt/dnf)" >&2
|
|
return 1
|
|
fi
|
|
}
|
|
|
|
# --- dependencies ---
|
|
|
|
if command -v pacman &>/dev/null; then
|
|
install_packages \
|
|
git zsh neovim ripgrep fd fzf \
|
|
clang rust-analyzer lua-language-server stylua cmake \
|
|
tinymist websocat \
|
|
ttf-firacode-nerd
|
|
elif command -v apt &>/dev/null; then
|
|
install_packages \
|
|
git zsh neovim ripgrep fd-find fzf \
|
|
clangd rust-analyzer cmake \
|
|
fonts-firacode
|
|
elif command -v dnf &>/dev/null; then
|
|
install_packages \
|
|
git zsh neovim ripgrep fd-find fzf \
|
|
clang-tools-extra rust-analyzer cmake \
|
|
fira-code-fonts
|
|
fi
|
|
|
|
# --- symlinks ---
|
|
|
|
for dir in "$DOTFILES"/config/*/; do
|
|
ln -sfn "$dir" "$HOME/.config/$(basename "$dir")"
|
|
done
|
|
|
|
# --- system config ---
|
|
|
|
sudo install -Dm644 "$DOTFILES/system/zshenv" /etc/zsh/zshenv
|