Files
bootstrap_dev_env/flatpak.go
T
Claude 658460fe4c port: rewrite bootstrap tool in Go
Replace the Python bootstrap script with a Go implementation that
cross-compiles to native binaries for Linux and macOS on x86_64 and
aarch64. The Go port preserves all sections of the original (system
packages, optional Flatpak GUI apps, custom downloads, and the macOS
firecracker VM bridge) and adds first-class pacman support so the tool
works on Arch-family distros alongside Debian, RHEL, and macOS.

A Makefile produces a host binary via `make build` and the full
four-target matrix under dist/ via `make build-all`.
2026-05-22 21:48:57 +00:00

34 lines
897 B
Go

package main
import "fmt"
func installFlatpakPackages(toInstall []string) {
fmt.Println("\n=== Flatpak Packages ===")
if !hasCmd("flatpak") {
fmt.Println(" flatpak is not installed.")
if !askYN(" Install flatpak now? [y/N] ") {
warn("flatpak not installed — skipping Flatpak section")
return
}
res := pkgInstall("flatpak")
if !res.OK() || !hasCmd("flatpak") {
errLog("flatpak installation failed — skipping Flatpak section")
return
}
}
runCmd([]string{
"flatpak", "remote-add", "--if-not-exists", "flathub",
"https://dl.flathub.org/repo/flathub.flatpakrepo",
}, CmdOpts{AsSudo: true})
for _, pkgID := range toInstall {
fmt.Printf("\n Installing %s ...\n", pkgID)
res := runCmd([]string{"flatpak", "install", "--noninteractive", "flathub", pkgID}, CmdOpts{})
if !res.OK() {
errLog(fmt.Sprintf("Flatpak failed to install: %s", pkgID))
}
}
}