[PATCH 2/3] img/app: run Flatpak applications

Alyssa Ross
2025-11-13T12:05:11Z

Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
img/app/default.nix | 1 +
img/app/file-list.mk | 1 +
.../image/etc/flatpak/installations.d/extra.conf | 5 +++++
img/app/image/etc/s6-rc/app/run | 14 +++++++++++++-
4 files changed, 20 insertions(+), 1 deletion(-)
create mode 100644 img/app/image/etc/flatpak/installations.d/extra.conf

diff --git a/img/app/default.nix b/img/app/default.nix
index 08cb2cd..ff402c1 100644
--- a/img/app/default.nix
+++ b/img/app/default.nix
@@ -49,6 +49,7 @@ let
name = "vm-fhs-env";
targetPkgs = pkgs: appimageTools.defaultFhsEnvArgs.targetPkgs pkgs ++ [
pkgs.fuse
+ pkgs.flatpak

(pkgs.busybox.override {
enableMinimal = true;
diff --git a/img/app/file-list.mk b/img/app/file-list.mk
index 506ab7a..cacc24f 100644
--- a/img/app/file-list.mk
+++ b/img/app/file-list.mk
@@ -3,6 +3,7 @@

FILES = \
image/etc/dbus-1/session.conf \
+ image/etc/flatpak/installations.d/extra.conf \
image/etc/fstab \
image/etc/init \
image/etc/mdev.conf \
diff --git a/img/app/image/etc/flatpak/installations.d/extra.conf b/img/app/image/etc/flatpak/installations.d/extra.conf
new file mode 100644
index 0000000..448902b
--- /dev/null
+++ b/img/app/image/etc/flatpak/installations.d/extra.conf
@@ -0,0 +1,5 @@
+# SPDX-License-Identifier: CC0-1.0
+# SPDX-FileCopyrightText: 2025 Alyssa Ross <hi@alyssa.is>
+
+[Installation "virtiofs"]
+Path=/run/virtiofs/virtiofs0/config/flatpak
diff --git a/img/app/image/etc/s6-rc/app/run b/img/app/image/etc/s6-rc/app/run
index 601926b..4b3b8d6 100755
--- a/img/app/image/etc/s6-rc/app/run
+++ b/img/app/image/etc/s6-rc/app/run
@@ -1,6 +1,6 @@
#!/bin/execlineb -P
# SPDX-License-Identifier: EUPL-1.2+
-# SPDX-FileCopyrightText: 2021, 2024 Alyssa Ross <hi@alyssa.is>
+# SPDX-FileCopyrightText: 2021, 2024-2025 Alyssa Ross <hi@alyssa.is>

export TMPDIR /run

@@ -25,6 +25,18 @@ foreground {
export LD_LIBRARY_PATH /lib64
/run/virtiofs/virtiofs0/config/run
}
+ flatpak {
+ s6-envdir -fnL /run/virtiofs/virtiofs0/config/params
+ multisubstitute {
+ importas -iu id id
+ importas -iu arch arch
+ importas -iu branch branch
+ importas -iu commit commit
+ importas -iu runtime_commit runtime-commit
+ }
+ flatpak run --installation=virtiofs --arch=${arch} --branch=${branch}
+ --commit=${commit} --runtime-commit=${runtime_commit} $id
+ }
nix {
if {
mount -t overlay
--
2.51.0