patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Alyssa Ross <hi@alyssa.is>
To: devel@spectrum-os.org
Cc: Demi Marie Obenour <demiobenour@gmail.com>
Subject: [PATCH v3 2/3] img/app: run Flatpak applications
Date: Thu, 27 Nov 2025 21:23:13 +0100	[thread overview]
Message-ID: <20251127202311.42422-5-hi@alyssa.is> (raw)
In-Reply-To: <20251127202311.42422-2-hi@alyssa.is>

Signed-off-by: Alyssa Ross <hi@alyssa.is>
---
v3: no changes
v2: https://spectrum-os.org/lists/archives/spectrum-devel/20251124194846.16338-3-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 6490ac2..c1a1706 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 6934975..4fbdec2 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/mdev.conf \
 	image/etc/mdev/iface \
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


  reply	other threads:[~2025-11-27 20:27 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-27 20:23 [PATCH v3 1/3] tools/mount-flatpak: init Alyssa Ross
2025-11-27 20:23 ` Alyssa Ross [this message]
2025-11-27 20:23 ` [PATCH v3 3/3] host/rootfs: add run-flatpak script Alyssa Ross
2025-11-29  1:49 ` [PATCH v3 1/3] tools/mount-flatpak: init Demi Marie Obenour
2025-11-29 19:00   ` Alyssa Ross
2025-11-29 20:10     ` Demi Marie Obenour
2025-11-30 17:24       ` Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251127202311.42422-5-hi@alyssa.is \
    --to=hi@alyssa.is \
    --cc=demiobenour@gmail.com \
    --cc=devel@spectrum-os.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).