···11+# Flatpak {#module-services-flatpak}
22+33+*Source:* {file}`modules/services/desktop/flatpak.nix`
44+55+*Upstream documentation:* <https://github.com/flatpak/flatpak/wiki>
66+77+Flatpak is a system for building, distributing, and running sandboxed desktop
88+applications on Linux.
99+1010+To enable Flatpak, add the following to your {file}`configuration.nix`:
1111+```
1212+ services.flatpak.enable = true;
1313+```
1414+1515+For the sandboxed apps to work correctly, desktop integration portals need to
1616+be installed. If you run GNOME, this will be handled automatically for you;
1717+in other cases, you will need to add something like the following to your
1818+{file}`configuration.nix`:
1919+```
2020+ xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
2121+```
2222+2323+Then, you will need to add a repository, for example,
2424+[Flathub](https://github.com/flatpak/flatpak/wiki),
2525+either using the following commands:
2626+```ShellSession
2727+$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
2828+$ flatpak update
2929+```
3030+or by opening the
3131+[repository file](https://flathub.org/repo/flathub.flatpakrepo) in GNOME Software.
3232+3333+Finally, you can search and install programs:
3434+```ShellSession
3535+$ flatpak search bustle
3636+$ flatpak install flathub org.freedesktop.Bustle
3737+$ flatpak run org.freedesktop.Bustle
3838+```
3939+Again, GNOME Software offers graphical interface for these tasks.
+2
nixos/modules/services/desktops/flatpak.nix
···77 cfg = config.services.flatpak;
88in {
99 meta = {
1010+ # Don't edit the docbook xml directly, edit the md and generate it:
1111+ # `pandoc flatpak.md -t docbook --top-level-division=chapter --extract-media=media -f markdown+smart --lua-filter ../../../../doc/build-aux/pandoc-filters/myst-reader/roles.lua --lua-filter ../../../../doc/build-aux/pandoc-filters/docbook-writer/rst-roles.lua > flatpak.xml`
1012 doc = ./flatpak.xml;
1113 maintainers = pkgs.flatpak.meta.maintainers;
1214 };
+52-51
nixos/modules/services/desktops/flatpak.xml
···11-<chapter xmlns="http://docbook.org/ns/docbook"
22- xmlns:xlink="http://www.w3.org/1999/xlink"
33- xmlns:xi="http://www.w3.org/2001/XInclude"
44- version="5.0"
55- xml:id="module-services-flatpak">
66- <title>Flatpak</title>
77- <para>
88- <emphasis>Source:</emphasis>
99- <filename>modules/services/desktop/flatpak.nix</filename>
1010- </para>
1111- <para>
1212- <emphasis>Upstream documentation:</emphasis>
1313- <link xlink:href="https://github.com/flatpak/flatpak/wiki"/>
1414- </para>
1515- <para>
1616- Flatpak is a system for building, distributing, and running sandboxed desktop
1717- applications on Linux.
1818- </para>
1919- <para>
2020- To enable Flatpak, add the following to your
2121- <filename>configuration.nix</filename>:
2222-<programlisting>
11+<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="module-services-flatpak">
22+ <title>Flatpak</title>
33+ <para>
44+ <emphasis>Source:</emphasis>
55+ <filename>modules/services/desktop/flatpak.nix</filename>
66+ </para>
77+ <para>
88+ <emphasis>Upstream documentation:</emphasis>
99+ <link xlink:href="https://github.com/flatpak/flatpak/wiki" role="uri">https://github.com/flatpak/flatpak/wiki</link>
1010+ </para>
1111+ <para>
1212+ Flatpak is a system for building, distributing, and running
1313+ sandboxed desktop applications on Linux.
1414+ </para>
1515+ <para>
1616+ To enable Flatpak, add the following to your
1717+ <filename>configuration.nix</filename>:
1818+ </para>
1919+ <programlisting>
2320 services.flatpak.enable = true;
2421</programlisting>
2525- </para>
2626- <para>
2727- For the sandboxed apps to work correctly, desktop integration portals need to
2828- be installed. If you run GNOME, this will be handled automatically for you;
2929- in other cases, you will need to add something like the following to your
3030- <filename>configuration.nix</filename>:
3131-<programlisting>
2222+ <para>
2323+ For the sandboxed apps to work correctly, desktop integration
2424+ portals need to be installed. If you run GNOME, this will be handled
2525+ automatically for you; in other cases, you will need to add
2626+ something like the following to your
2727+ <filename>configuration.nix</filename>:
2828+ </para>
2929+ <programlisting>
3230 xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];
3331</programlisting>
3434- </para>
3535- <para>
3636- Then, you will need to add a repository, for example,
3737- <link xlink:href="https://github.com/flatpak/flatpak/wiki">Flathub</link>,
3838- either using the following commands:
3939-<screen>
4040-<prompt>$ </prompt>flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
4141-<prompt>$ </prompt>flatpak update
4242-</screen>
4343- or by opening the
4444- <link xlink:href="https://flathub.org/repo/flathub.flatpakrepo">repository
4545- file</link> in GNOME Software.
4646- </para>
4747- <para>
4848- Finally, you can search and install programs:
4949-<screen>
5050-<prompt>$ </prompt>flatpak search bustle
5151-<prompt>$ </prompt>flatpak install flathub org.freedesktop.Bustle
5252-<prompt>$ </prompt>flatpak run org.freedesktop.Bustle
5353-</screen>
5454- Again, GNOME Software offers graphical interface for these tasks.
5555- </para>
3232+ <para>
3333+ Then, you will need to add a repository, for example,
3434+ <link xlink:href="https://github.com/flatpak/flatpak/wiki">Flathub</link>,
3535+ either using the following commands:
3636+ </para>
3737+ <programlisting>
3838+$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
3939+$ flatpak update
4040+</programlisting>
4141+ <para>
4242+ or by opening the
4343+ <link xlink:href="https://flathub.org/repo/flathub.flatpakrepo">repository
4444+ file</link> in GNOME Software.
4545+ </para>
4646+ <para>
4747+ Finally, you can search and install programs:
4848+ </para>
4949+ <programlisting>
5050+$ flatpak search bustle
5151+$ flatpak install flathub org.freedesktop.Bustle
5252+$ flatpak run org.freedesktop.Bustle
5353+</programlisting>
5454+ <para>
5555+ Again, GNOME Software offers graphical interface for these tasks.
5656+ </para>
5657</chapter>