{ pkgs, ... }: { # Install OpenLP from official flatpak bundle # Update the version in the URL when new releases are available systemd.services.openlp-flatpak-install = { description = "Install OpenLP from official flatpak bundle"; wantedBy = [ "multi-user.target" ]; after = [ "network-online.target" ]; wants = [ "network-online.target" ]; serviceConfig = { Type = "oneshot"; RemainAfterExit = true; ExecStart = pkgs.writeShellScript "install-openlp" '' set -e OPENLP_VERSION="3.1.7" OPENLP_URL="https://get.openlp.org/$OPENLP_VERSION/openlp-$OPENLP_VERSION-1.flatpak" OPENLP_ID="org.openlp.OpenLP" # Check if already installed if ${pkgs.flatpak}/bin/flatpak list --app | grep -q "$OPENLP_ID"; then echo "OpenLP is already installed" exit 0 fi # Download and install the bundle echo "Downloading OpenLP $OPENLP_VERSION..." TEMP_FILE=$(${pkgs.coreutils}/bin/mktemp) ${pkgs.curl}/bin/curl -L -o "$TEMP_FILE" "$OPENLP_URL" echo "Installing OpenLP from bundle..." ${pkgs.flatpak}/bin/flatpak install --system --bundle --noninteractive -y "$TEMP_FILE" # Cleanup ${pkgs.coreutils}/bin/rm -f "$TEMP_FILE" echo "OpenLP installed successfully" ''; }; }; }