Awesome
flatpaks
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.
How to build
- Install flatpak-builder
- Clone the flatpaks repo
git clone https://github.com/tinywrkb/flatpaks.git
git submodule init
git submodule update
- Create a working folder for flatpak-builder somewhere
mkdir build
- Build the package with flatpak-builder and install it as a user Flatpak app.
Replace
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
Tips and tricks
Font packages
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.
- Give all our Flatpak apps access to the user's fontconfig configuration file, and also the font
package installed path.
Due to a mismatch ofXDG_CONFIG_DIR
value between the host and the Flatpak sandbox (a different path for each app), we need to set some environment variables.
Also note that the fontconfig variable value need to be an absolute path, meaning it needs to be expanded before given to theflatpak 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
- Adding the following to
$XDG_CONFIG_HOME/fontconfig/fonts.conf
will tell fontconfig to include the Flatpak font package in its scan.
The first directive is required because fc-cache omits the default font locations when scanning inside a Flatpak sandbox, and that's due to our use ofFONTCONFIG_FILE
variable.
Note that you need to replace{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'sfonts.conf
is including the system'sconf.d
folder, as fontconfig might not find the system'sconf.d
if it was set as a relative path in the system'sfonts.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
- To update the font cache of a Flatpak app sandbox just restart the app.
Fontconfig related bugs
- Flatpak: Expose host fontconfig conf.d?
- Flatpak: Expose xdg-config/fontconfig to sandbox by default
- freedesktop-sdk: Support font extensions
- Fontconfig: Add support for XDG_DATA_DIRS
extra-data caching and avoiding download
Copy the extra-data source into FLATAPK_INSTALLATION_PATH/extra-data/CHECKSUM/FILENAME
.
Terminal emulators: host access
- SSH over tcp, use keys from an already running ssh-agent session.
- SSH over a unix socket using socat.
- Start a shell session on the host using flatpak-spawn.
This actually doesn't work correcty, and the proper solution is implemented in flatterm.- Create an override:
$ flatpak override --user --talk-name=org.freedesktop.Flatpak FLATPAK_ID
- From the sandbox, start a shell session on the host:
$ flatpak-spawn --host /bin/bash
- Create an override:
- Use a terminal multiplexer.
- Set the multiplexer socket path to a folder that can be bind mounted into the sandbox.
export SCREENDIR=$XDG_RUNTIME_DIR/screen export TMUX_TMPDIR=$XDG_RUNTIME_DIR/tmux
- Create the multiplexer socket folder on boot with systemd-tempfiles.
# $XDG_CONFIG_HOME/user-tmpfiles.d/tmux.conf d %t/tmux 0700 - - - -
# $XDG_CONFIG_HOME/user-tmpfiles.d/screen.conf d %t/screen 0700 - - - -
- Make sure the systemd-tempfiles user service was started and enabled.
$ systemctl --user enable --now systemd-tmpfiles-setup.service
- Create overrides.
$ flatpak override --user --filesystem=xdg-run/tmux FLATPAK_ID $ flatpak override --user --filesystem=xdg-run/screen FLATPAK_ID
List of applications
Container and virtualization
Development
Development/Binary analysis
Development/Binary analysis/Assembler & disassemblers
Development/Binary analysis/ELF
Development/Binary analysis/Hex editors & viewers
Development/Binary analysis/Firmware
Development/Binary analysis/PE
Development/Database
Development/Debugging
Development/Flatpak
- Flatpak Builder (Also on Flathub as
org.flatpak.Builder
)
Development/Kernel
Development/Markup & data serialization
Development/Python
Development/VCS
Display server
Display server/Remoting and screen sharing
Display server/Screen config managers
Display server/Shell
Display server/X11
Documents
Documents/Journaling
Documents/Notetaking
Documents/Office suites and editors
Documents/PDF tools
- PDFSam (check out PDF Mix Tool, it might be a better choice)
- pdfcrack
Documents/Text editors
Documents/Viewers
Electronics
Electronics/Analog circuit simulation
Electronics/Digital logic
Electronics/Embedded
- ARM Mbed Studio
- Arduino CLI
- Arduino Create Agent
- Code With Mu
- Microchip MPLAB X IDE
- NXP MCUXpresso IDE (Authenticated download is required now. Use the extra-data caching method)
- PICsimLab
- TI CCSTUDIO IDE
Electronics/HDL
- Icestudio
- Lattice Diamond
- Papilio DesignLab IDE (Abandoned)
- Intel Quartus Prime ModelSim Altera Starter Edition
- Intel Quartus Prime Lite
Electronics/Printed circuit board design
Electronics/Signals
Electronics/Signals/Instrumentation
Science/Electronics/Signals/SDR
- GNU Radio
- Gqrx SDR
- QSpectrumAnalyzer
- SDR# (Latest Linux Mono compatible version)
- SDR# (Windows) (WIP, no drivers, SPY server only)
- SigDigger
Engineering
Engineering/CAD
- BRL-CAD
- Fusion 360 (WIP, not working correctly ATM)
- LibreCAD
- QCAD
Engineering/Calculators and unit converters
Games
- Cemu (WIP)
- SDLPoP: Prince of Persia
Files
Files/Mobile devices
Files/File managers
Files/Archiving and compression tools
Files/Duplicates cleaners
Fonts
Fonts/Tools
Internet
Internet/Communication
Internet/File sharing
Internet/File sharing/BitTorrent
Internet/File sharing/Cloud sync
Internet/Media downloaders
Internet/URL watcher
Internet/Web browsers
Math
Math/Algebra
Multimedia
Multimedia/Codecs
Multimedia/Icons
Multimedia/Image
Multimedia/Image/Screenshot
Multimedia/Audio
Multimedia/Video
- mpv (Also on Flathub as
io.mpv.Mpv
)
Network
Network/Diagnostics
Network/Network managers
- Airport Utility (WIP)
- iwgtk
Security
Security/2FA, passwords & keys
Security/Analysis & pentesting
System
System/Benchmarking & diagnostics
- GFXBench (BROKEN, extreme memory leak)
- Unigine Heaven
- Unigine Heaven (Windows) (WIP)
- mesa-demos
- s-tui