chore(bling): remove flatpaksync, leave a warning message

This commit is contained in:
xyny 2024-07-27 17:56:32 +03:00
parent 368f28ea0b
commit 55e93286ff
8 changed files with 8 additions and 98 deletions

View file

@ -6,23 +6,6 @@ The bling to pull in is declared under `install:`, and the code for installing t
## Submodule documentation
### `flatpaksync` (unmaintained)
The `flatpaksync` submodule can be used to synchronize a list of user Flatpaks with a git repository.
Once the submodule is activated, you should create the file `$HOME/.config/flatpaksync/env` that sets the `GIT_REPO` variable to the git URL of your repository. This repository can be empty, or a previous flatpaksync installation. The repository is automatically cloned into `/tmp/sync` for the synchronization.
```bash
# ~/.config/flatpaksync/env
GIT_REPO=<YOUR_REPO>
```
To initialize your Flatpaks from flatpaksync, simply run the `flatpakcheckout` command to perform the installation and start the synchronization.
**It is important to note that this submodule will NOT enable Flathub. If your applications come from there, you will need to enable Flathub before running it.**
If you have configured the repository in the `$HOME/.config/flatpaksync/env` file but already have the Flatpaks installed, simply create the `$HOME/.config/flatpaks.user.installed` file to inform the script that the installation is done and start the synchronization.
### `dconf-update-service`
The `dconf-update-service` submodule creates a systemd unit to automatically update changes you make to [dconf](https://wiki.gnome.org/Projects/dconf) in your custom image. For an example of a dconf keyfile, see the [dconf custom defaults documentation](https://help.gnome.org/admin/system-admin-guide/stable/dconf-custom-defaults.html.en).

View file

@ -9,5 +9,5 @@ model BlingModule {
type: "bling";
/** List of bling submodules to run / things to install onto your system. */
install: Array<"ublue-update" | "1password" | "dconf-update-service" | "gnome-vrr" | "laptop" | "flatpaksync">;
install: Array<"ublue-update" | "1password" | "dconf-update-service" | "gnome-vrr" | "laptop">;
}

View file

@ -1,29 +0,0 @@
#!/usr/bin/env bash
source $HOME/.config/flatpaksync/env
CHECKOUT_DIR=/tmp/sync
rm -rf $CHECKOUT_DIR
if [[ -n "${GIT_REPO}" ]]; then
git clone "$GIT_REPO" $CHECKOUT_DIR || exit 0
while IFS=$'\n' read -r app; do
flatpak install --user --noninteractive "$app" -y || HAS_FAILED="yes"
done <$CHECKOUT_DIR/flatpak.list
if [[ -z "${HAS_FAILED}" ]]; then
touch "$HOME"/.config/flatpaks.user.installed
fi
else
echo "Repository not specified. Please enter it in $HOME/.config/flatpaksync/env in the POSIX pattern: GIT_REPO=<YOUR_REPO>"
fi

View file

@ -1,13 +0,0 @@
#!/usr/bin/env bash
CHECKOUT_DIR=/tmp/sync
rm -rf $CHECKOUT_DIR
git clone "$GIT_REPO" $CHECKOUT_DIR || exit 0
flatpak list --app --columns=app --user > $CHECKOUT_DIR/flatpak.list
cd $CHECKOUT_DIR || exit 0
git add . && git commit -m "." && git push

View file

@ -1,10 +0,0 @@
[Unit]
Description=Service monitoring the ~/.var/app directory
[Path]
PathChanged=%h/.var/app
PathChanged=%h/.config/flatpaks.user.installed
Unit=flatpaksync.service
[Install]
WantedBy=default.target

View file

@ -1,12 +0,0 @@
[Unit]
Description=Flatpak synchronization service
ConditionPathExists=%h/.config/flatpaksync/env
ConditionPathExists=%h/.config/flatpaks.user.installed
[Service]
EnvironmentFile=%h/.config/flatpaksync/env
ExecStart=/usr/bin/flatpaksync
Type=simple
[Install]
WantedBy=default.target

View file

@ -1,19 +1,11 @@
#!/usr/bin/env bash
set -euo pipefail
MODULE_DIRECTORY="${MODULE_DIRECTORY:-"/tmp/modules"}"
echo "Attention: flatpaksync has been removed from the bling module due to it being unmaintained and unused."
echo "If you need this module and want to resurrect it, you can find the source code and documentation in the URLs below:"
echo "https://github.com/blue-build/modules/tree/af2db664acdcf05eedd4780736d420b87691d60f/modules/bling/flatpaksync"
echo "https://github.com/blue-build/modules/blob/af2db664acdcf05eedd4780736d420b87691d60f/modules/bling/installers/flatpaksync.sh"
echo "https://github.com/blue-build/modules/blob/af2db664acdcf05eedd4780736d420b87691d60f/modules/bling/README.md#flatpaksync-unmaintained"
echo "To fix your build: remove the flatpaksync entry from your bling module configuration"
SYSTEMD_USER_JOBS_DIR="/usr/lib/systemd/user"
mkdir -p "$SYSTEMD_USER_JOBS_DIR"
chmod +x "$MODULE_DIRECTORY"/bling/flatpaksync/flatpaksync
chmod +x "$MODULE_DIRECTORY"/bling/flatpaksync/flatpakcheckout
cp -r "$MODULE_DIRECTORY"/bling/flatpaksync/flatpaksync /usr/bin/flatpaksync
cp -r "$MODULE_DIRECTORY"/bling/flatpaksync/flatpakcheckout /usr/bin/flatpakcheckout
cp -r "$MODULE_DIRECTORY"/bling/flatpaksync/flatpaksync.service "$SYSTEMD_USER_JOBS_DIR/flatpaksync.service"
cp -r "$MODULE_DIRECTORY"/bling/flatpaksync/flatpaksync.path "$SYSTEMD_USER_JOBS_DIR/flatpaksync.path"
systemctl enable --global flatpaksync.path
exit 1

View file

@ -8,4 +8,3 @@ example: |
- dconf-update-service # a service unit that updates the dconf db on boot
- gnome-vrr # enables gnome-vrr for your image
- laptop # installs TLP and configures your system for laptop usage
- flatpaksync # allows synchronization of user-installed flatpaks, see separate documentation section