-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforge
More file actions
executable file
·46 lines (40 loc) · 1.97 KB
/
Copy pathforge
File metadata and controls
executable file
·46 lines (40 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
# Cross-distro bootstrap: stow user-level dotfiles + install Antidote.
# Optionally drives a system package install on Arch (pacman). On NixOS,
# packages are declared in the system flake/configuration.nix, so the
# package step is a no-op here.
PACKAGESTOINSTALL=('aria2' 'bat' 'borg' 'btop' 'eza' 'fd' 'firefox' 'fzf' 'jdk-openjdk' 'keepassxc' 'kitty' 'mpv' 'neovim' 'ripgrep' 'rustup' 'syncthing' 'tealdeer' 'thunderbird' 'yt-dlp' 'zoxide' 'zsh')
PACKAGESTOSTOW=('aria2' 'btop' 'eza' 'fzf' 'git' 'kitty' 'mpv' 'nnn' 'neovim' 'scripts' 'tealdeer' 'yt-dlp' 'zsh')
# 1. System package install (Arch only). NixOS handles this declaratively.
if [[ -f /etc/NIXOS ]] || command -V nixos-rebuild &>/dev/null; then
echo "NixOS detected — skipping package install (manage packages in your flake/configuration.nix)."
elif command -V pacman &>/dev/null; then
echo "Starting system upgrade and package install..."
if ! sudo pacman -Syu --needed "${PACKAGESTOINSTALL[@]}"; then
echo "Error: pacman transaction failed. Exiting..."
exit 1
fi
echo "All packages installed successfully."
else
echo "Warning: no supported package manager found — skipping package install."
fi
# 2. Symlink dotfiles via GNU stow.
echo "Setting up dotfiles..."
cd ~/dotfiles/ || {
echo "Directory ~/dotfiles/ not found! Exiting."
exit 1
}
if ! command -V stow &>/dev/null; then
echo "Error: stow not found. Install it first (Arch: pacman -S stow; NixOS: add 'stow' to your packages)."
exit 1
fi
stow -R "${PACKAGESTOSTOW[@]}"
# 3. Install Antidote (zsh plugin manager) into ~/.antidote if missing.
# On NixOS, Antidote is typically provided by the system (programs.zsh.antidote
# or the 'antidote' package), in which case this clone is unnecessary — the
# directory check below makes it a no-op.
if [[ ! -d ~/.antidote ]] && [[ ! -d /run/current-system/sw/share/antidote ]]; then
echo "Installing Antidote..."
git clone --depth=1 https://github.com/mattmc3/antidote.git ~/.antidote
fi
echo "Setup complete!"