2018-05-11 06:00:44 +02:00
<chapter xmlns= "http://docbook.org/ns/docbook"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xi="http://www.w3.org/2001/XInclude"
version="5.0"
xml:id="module-services-flatpak">
2018-09-30 02:51:11 +02:00
<title > Flatpak</title>
<para >
2019-09-18 22:13:35 +02:00
<emphasis > Source:</emphasis> <filename > modules/services/desktop/flatpak.nix</filename>
2018-09-30 02:51:11 +02:00
</para>
<para >
2019-09-18 22:13:35 +02:00
<emphasis > Upstream documentation:</emphasis> <link xlink:href= "https://github.com/flatpak/flatpak/wiki" />
2018-09-30 02:51:11 +02:00
</para>
<para >
2019-09-18 22:13:35 +02:00
Flatpak is a system for building, distributing, and running sandboxed desktop applications on Linux.
2018-09-30 02:51:11 +02:00
</para>
<para >
2019-09-18 22:13:35 +02:00
To enable Flatpak, add the following to your <filename > configuration.nix</filename> :
2018-09-30 02:51:11 +02:00
<programlisting >
2018-05-11 06:00:44 +02:00
<xref linkend= "opt-services.flatpak.enable" /> = true;
2019-06-17 12:01:51 +02:00
</programlisting>
2018-09-30 02:51:11 +02:00
</para>
<para >
2019-09-18 22:13:35 +02:00
For the sandboxed apps to work correctly, desktop integration portals need to be installed. If you run GNOME, this will be handled automatically for you; in other cases, you will need to add something like the following to your <filename > configuration.nix</filename> :
2018-09-30 02:51:11 +02:00
<programlisting >
2019-07-19 02:40:24 +02:00
<xref linkend= "opt-xdg.portal.extraPortals" /> = [ pkgs.xdg-desktop-portal-gtk ];
2019-06-17 12:01:51 +02:00
</programlisting>
2018-09-30 02:51:11 +02:00
</para>
<para >
2019-09-18 22:13:35 +02:00
Then, you will need to add a repository, for example, <link xlink:href= "https://github.com/flatpak/flatpak/wiki" > Flathub</link> , either using the following commands:
2019-06-17 12:01:51 +02:00
<screen >
<prompt > $ </prompt> flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
<prompt > $ </prompt> flatpak update
</screen>
2019-09-18 22:13:35 +02:00
or by opening the <link xlink:href= "https://flathub.org/repo/flathub.flatpakrepo" > repository file</link> in GNOME Software.
2018-09-30 02:51:11 +02:00
</para>
<para >
2018-05-11 06:00:44 +02:00
Finally, you can search and install programs:
2019-06-17 12:01:51 +02:00
<screen >
<prompt > $ </prompt> flatpak search bustle
<prompt > $ </prompt> flatpak install flathub org.freedesktop.Bustle
<prompt > $ </prompt> flatpak run org.freedesktop.Bustle
</screen>
2018-05-11 06:00:44 +02:00
Again, GNOME Software offers graphical interface for these tasks.
2018-09-30 02:51:11 +02:00
</para>
2018-05-11 06:00:44 +02:00
</chapter>