diff --git a/README.md b/README.md index 388ff82..c9c223e 100644 --- a/README.md +++ b/README.md @@ -71,6 +71,8 @@ The scripts install lots of useful software. There are (4) main ways software is Pacman installs software from the "packages.conf" file. It installs software such as neovim, tmux, Go, Rust, Docker, Tailscale, Element, LibreOffice, etc. Tell me if you want other tools or submit a pull request. +Federated Computer's own packages, such as Federated Calendar, come from the `[federated]` repository on Federated Computer's Gitea. CoreDesktop adds it to /etc/pacman.conf and trusts its signing key (fingerprint `6AB7C080D87C74BEE3925A026329376994F18B4E`), so they install and update like any other pacman package. Federated Calendar is installed alongside GNOME Calendar and can invite people to events on your Core's Nextcloud calendars. + ### AUR Yay is installed as is the way AUR packages are installed and maintained. Examples include the Helium Browser and Winboat. Helium is made the default browser once; you can choose another in Settings > Apps > Default Apps. diff --git a/install.sh b/install.sh index 8ae971a..42b60e2 100755 --- a/install.sh +++ b/install.sh @@ -71,6 +71,10 @@ source packages.conf echo "Starting full system setup..." +# Federated Computer's own packages (Federated Calendar, ...) +echo "Adding the Federated Computer package repo..." +ensure_federated_repo + # Bring the system fully up to date before installing anything new echo "Updating system..." sudo pacman -Sy --needed --noconfirm archlinux-keyring diff --git a/packages.conf b/packages.conf index a670754..f28267c 100644 --- a/packages.conf +++ b/packages.conf @@ -124,6 +124,7 @@ DESKTOP=( cliamp cline-desktop element-desktop + federated-calendar gnome gnome-tweaks helium-browser-bin diff --git a/updates.d/10-pacman.sh b/updates.d/10-pacman.sh index ad87e09..ef19b6d 100644 --- a/updates.d/10-pacman.sh +++ b/updates.d/10-pacman.sh @@ -12,6 +12,11 @@ echo "Removing unwanted packages..." remove_packages "${REMOVE_PACMAN[@]}" remove_flatpaks "${REMOVE_FLATPAKS[@]}" +# Machines installed before Federated Calendar need the repo before the -Sy +# below and install_packages, so this can't wait for a migration +echo "Checking the Federated Computer package repo..." +ensure_federated_repo || STATUS=1 + # A machine that hasn't updated in a while can have a keyring too old to verify # the new packages. Update it first; the -Su below completes this -Sy. echo "Updating Arch keyring..." diff --git a/utils.sh b/utils.sh index 1d6c702..b595aa9 100755 --- a/utils.sh +++ b/utils.sh @@ -36,6 +36,23 @@ install_packages() { fi } +FEDERATED_REPO_URL="https://gitea.federated.computer/api/packages/Federated_Computer/arch" +FEDERATED_REPO_KEY="6AB7C080D87C74BEE3925A026329376994F18B4E" + +# Add Federated Computer's pacman repo, which Gitea serves and signs, and trust +# its key. Does nothing if both are already set up. +ensure_federated_repo() { + if ! sudo pacman-key --list-keys "$FEDERATED_REPO_KEY" &> /dev/null; then + curl -fsSL "$FEDERATED_REPO_URL/repository.key" | sudo pacman-key --add - || return 1 + sudo pacman-key --lsign-key "$FEDERATED_REPO_KEY" > /dev/null || return 1 + fi + + if ! grep -q '^\[federated\]' /etc/pacman.conf; then + printf '\n[federated]\nSigLevel = Required DatabaseRequired\nServer = %s/$repo/$arch\n' \ + "$FEDERATED_REPO_URL" | sudo tee -a /etc/pacman.conf > /dev/null || return 1 + fi +} + # Function to install pipx applications if not already installed install_pipx_apps() { local installed app status=0