Moonlight went on the work laptop as a flatpak, which neither apt-mark nor pacman can see — so a rebuild from the manifests would have silently left it out. pkg-restore adds the flathub user remote before installing, since Ubuntu ships flathub as a system remote that --user cannot resolve. System-scope flatpaks are deliberately not recorded: those belong to whoever administers the machine, not to these dotfiles.
23 lines
950 B
Bash
Executable File
23 lines
950 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Install everything this host's manifest names. Safe to re-run: --needed and
|
|
# apt's own idempotence mean already-installed packages are skipped.
|
|
set -euo pipefail
|
|
REPO="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
|
|
HOST="${DOTFILES_HOST:-$(uname -n | tr '[:upper:]' '[:lower:]')}"
|
|
P="${REPO}/packages"
|
|
|
|
if [[ -f "${P}/${HOST}.pacman" ]]; then
|
|
sudo pacman -S --needed --noconfirm - < "${P}/${HOST}.pacman"
|
|
[[ -f "${P}/${HOST}.aur" ]] && paru -S --needed --noconfirm - < "${P}/${HOST}.aur"
|
|
elif [[ -f "${P}/${HOST}.apt" ]]; then
|
|
xargs -a "${P}/${HOST}.apt" sudo apt-get install -y
|
|
else
|
|
echo "pkg-restore: no manifest for '${HOST}' in ${P}" >&2; exit 1
|
|
fi
|
|
|
|
if [[ -f "${P}/${HOST}.flatpak" ]] && command -v flatpak >/dev/null 2>&1; then
|
|
flatpak remote-add --user --if-not-exists flathub \
|
|
https://dl.flathub.org/repo/flathub.flatpakrepo
|
|
xargs -r -a "${P}/${HOST}.flatpak" flatpak install -y --user flathub
|
|
fi
|