From a4f804996b85fc4c982f05069466aeb80de6dc01 Mon Sep 17 00:00:00 2001 From: Emil Miler Date: Wed, 25 Feb 2026 16:21:24 +0100 Subject: [PATCH] Install Flatpak --- group_vars/all.yaml | 10 +++++++--- setup.yaml | 47 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+), 3 deletions(-) diff --git a/group_vars/all.yaml b/group_vars/all.yaml index 78b1aa5..1e48bde 100644 --- a/group_vars/all.yaml +++ b/group_vars/all.yaml @@ -3,6 +3,10 @@ timeout_blank: 1800 timeout_lock: 30 grub_timeout: 10 +flatpak_install: + - com.prusa3d.PrusaSlicer + - cc.arduino.IDE2 + xbps_install: # General - htop @@ -24,8 +28,6 @@ xbps_install: - nano - emacs - vscode - - arduino - - arduino-cli - idle-python3 - platformio - openjdk @@ -65,7 +67,6 @@ xbps_install: - asciiquarium - cbonsai - cmatrix - # - openarena # GNOME # A custom list intead of `gnome-apps` meta package - eog @@ -93,3 +94,6 @@ xbps_install: - gnome-dictionary xbps_remove: - gnome-apps + - arduino # Old version; Install flatpak for v2 + - arduino-cli + - PrusaSlicer # Removed from Void repos; Install Flatpak diff --git a/setup.yaml b/setup.yaml index c6ce452..31cb777 100644 --- a/setup.yaml +++ b/setup.yaml @@ -123,6 +123,53 @@ command: 'vkpurge rm all' +- name: Flatpak + hosts: all + tags: flatpak + + tasks: + - name: Install Flatpak + package: + name: flatpak + state: present + + - name: Add Flathub remote + community.general.flatpak_remote: + name: flathub + state: present + flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo + method: system + + - name: Install Flatpak applications + community.general.flatpak: + name: "{{ item }}" + state: present + remote: flathub + method: system + loop: "{{ flatpak_install }}" + + - name: Update all installed Flatpaks + command: flatpak update -y + register: flatpak_update + changed_when: "'Nothing to do.' not in flatpak_update.stdout" + + - name: Ensure Flatpak export paths are in XDG_DATA_DIRS + copy: + dest: /etc/profile.d/flatpak.sh + mode: '0644' + content: | + # Flatpak desktop file integration + if [ -d /var/lib/flatpak/exports/share ]; then + XDG_DATA_DIRS="/var/lib/flatpak/exports/share:${XDG_DATA_DIRS:-/usr/local/share:/usr/share}" + fi + + if [ -d "$HOME/.local/share/flatpak/exports/share" ]; then + XDG_DATA_DIRS="$HOME/.local/share/flatpak/exports/share:$XDG_DATA_DIRS" + fi + + export XDG_DATA_DIRS + + - name: Gnome hosts: all tags: