A few Flatpaks that I hastly packaged. These are not thoroughly tested so use at your own discretion.
Packaging was adapted mainly from Arch Linux's official PKGBUILDs and the AUR.
Most of these are PoC, not maintained, might need some cleanup, missing a feature here and there,
and in general are not ready to publish via Flathub.
The catalyst for packaging these apps is to prove that it's possible to convert to, and as a precondition
for switching to an immutable system, an OS that has a clear seperation between the stateless
read-only distributed OS files, and the stateful data and configs.
git clone https://github.com/tinywrkb/flatpaks.git
git submodule init
git submodule update
mkdir build
manifest.yaml
with the path to application manifest.
flatpak-builder --install --user --force-clean \
--state-dir=build/flatpak-builder \
--repo=build/flatpak-repo build/flatpak-target \
manifest.yaml
Flatpak does not support font packages or extensions. In order for Flatpak and host apps to use fonts installed as Flatpak package we need a few workarounds.
XDG_CONFIG_DIR
value between the host and the Flatpak sandbox (a different
path for each app), we need to set some environment variables.flatpak override
command.
$ flatpak override --user \
--filesystem=~/.config/fontconfig:ro \
--filesystem=~/.local/share/flatpak:ro \
--filesystem=/var/lib/flatpak:ro \
--env=FONTCONFIG_FILE=$XDG_CONFIG_HOME/fontconfig/fonts.conf
If your fontconfig folder is in dotfiles, then apps that use the --persist=.
permission (e.g. Steam)
will fail to start after a first seccessful run and will output the following error message.
bwrap: Can't make symlink at /home/USER/.config/fontconfig: File exists
The workaround for this issue is to create first a ~/.config/fontconfig
folder before creating
the dotfiles symlinks, so the folder will be bind mounted into the container instead of having
flatpak try creating a ~/.config/fontconfig
symlink on each run.
This workaround requires adding a filesystem access permission to the dotfiles folder.
$ flatpak override --user \
--filesystem=~/.dotfiles/fontconfig/.config/fontconfig:ro
$XDG_CONFIG_HOME/fontconfig/fonts.conf
will tell fontconfig to include
the Flatpak font package in its scan.FONTCONFIG_FILE
variable.{FontName}
with the name of the font as defined in the Flatpak
app ID, see for example the Noto fonts packages.<include ignore_missing="yes">/etc/fonts/fonts.conf</include>
<dir prefix="default">.local/share/flatpak/app/org.freedesktop.Platform.Fonts.{FontName}/current/active/files/share/fonts</dir>
<dir>/var/lib/flatpak/app/org.freedesktop.Platform.Fonts.{FontName}/current/active/files/share/fonts</dir>
<include prefix="default" ignore_missing="yes">.local/share/flatpak/app/org.freedesktop.Platform.Fonts.{FontName}/current/active/files/share/fonts/conf.d</include>
<include ignore_missing="yes">/var/lib/flatpak/app/org.freedesktop.Platform.Fonts.{FontName}/current/active/files/share/fonts/conf.d</include>
You can also set FONTCONFIG_PATH
, but make sure that your user's fonts.conf
is including the system's conf.d
folder, as fontconfig might not find the system's conf.d
if it was set as a relative path in the system's fonts.conf
.
$ flatpak override --user \
--env=FONTCONFIG_PATH=$XDG_CONFIG_HOME/fontconfig
Add the include
element to your user's fonts.conf
.
<include ignore_missing="yes">/etc/fonts/conf.d</include>
Now we can update the host's font cache.
cd ~
fc-cache
Copy the extra-data source into FLATAPK_INSTALLATION_PATH/extra-data/CHECKSUM/FILENAME
.
$ flatpak override --user --talk-name=org.freedesktop.Flatpak FLATPAK_ID
$ flatpak-spawn --host /bin/bash
export SCREENDIR=$XDG_RUNTIME_DIR/screen
export TMUX_TMPDIR=$XDG_RUNTIME_DIR/tmux
# $XDG_CONFIG_HOME/user-tmpfiles.d/tmux.conf
d %t/tmux 0700 - - - -
# $XDG_CONFIG_HOME/user-tmpfiles.d/screen.conf
d %t/screen 0700 - - - -
$ systemctl --user enable --now systemd-tmpfiles-setup.service
$ flatpak override --user --filesystem=xdg-run/tmux FLATPAK_ID
$ flatpak override --user --filesystem=xdg-run/screen FLATPAK_ID
org.flatpak.Builder
)io.mpv.Mpv
)