pkg-snapshot: record user-scope flatpaks too

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.
This commit is contained in:
connor committed 2026-09-14 15:51:14 -04:00
1 parent de78118624
commit 55a2c59645
2 files changed
+17

No files matched your search

+6
View File
@@ -14,3 +14,9 @@ elif [[ -f "${P}/${HOST}.apt" ]]; then
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
+11
View File
@@ -18,3 +18,14 @@ elif command -v apt-mark >/dev/null 2>&1; then
else
echo "pkg-snapshot: no pacman or apt-mark on this machine" >&2; exit 1
fi
# Flatpaks are invisible to both package managers, so record them separately.
# User-scope only: system-scope flatpaks belong to whoever administers the box.
if command -v flatpak >/dev/null 2>&1; then
flatpak list --app --user --columns=application 2>/dev/null | LC_ALL=C sort > "${OUT}/${HOST}.flatpak"
if [[ -s "${OUT}/${HOST}.flatpak" ]]; then
echo "wrote ${HOST}.flatpak ($(wc -l < "${OUT}/${HOST}.flatpak"))"
else
rm -f "${OUT}/${HOST}.flatpak"
fi
fi