From 8422592cf883014eba46cc24b60b043dd5590dba Mon Sep 17 00:00:00 2001 From: pennae Date: Tue, 3 Jan 2023 01:06:30 +0100 Subject: [PATCH] nixos/flatpak: convert manual chapter to MD --- nixos/modules/services/desktops/flatpak.md | 39 ++++++++ nixos/modules/services/desktops/flatpak.nix | 2 + nixos/modules/services/desktops/flatpak.xml | 103 ++++++++++---------- 3 files changed, 93 insertions(+), 51 deletions(-) create mode 100644 nixos/modules/services/desktops/flatpak.md diff --git a/nixos/modules/services/desktops/flatpak.md b/nixos/modules/services/desktops/flatpak.md new file mode 100644 index 000000000000..65b1554d79b4 --- /dev/null +++ b/nixos/modules/services/desktops/flatpak.md @@ -0,0 +1,39 @@ +# Flatpak {#module-services-flatpak} + +*Source:* {file}`modules/services/desktop/flatpak.nix` + +*Upstream documentation:* + +Flatpak is a system for building, distributing, and running sandboxed desktop +applications on Linux. + +To enable Flatpak, add the following to your {file}`configuration.nix`: +``` + services.flatpak.enable = true; +``` + +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 +{file}`configuration.nix`: +``` + xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; +``` + +Then, you will need to add a repository, for example, +[Flathub](https://github.com/flatpak/flatpak/wiki), +either using the following commands: +```ShellSession +$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +$ flatpak update +``` +or by opening the +[repository file](https://flathub.org/repo/flathub.flatpakrepo) in GNOME Software. + +Finally, you can search and install programs: +```ShellSession +$ flatpak search bustle +$ flatpak install flathub org.freedesktop.Bustle +$ flatpak run org.freedesktop.Bustle +``` +Again, GNOME Software offers graphical interface for these tasks. diff --git a/nixos/modules/services/desktops/flatpak.nix b/nixos/modules/services/desktops/flatpak.nix index 3b14ad75ab30..367d367d0bce 100644 --- a/nixos/modules/services/desktops/flatpak.nix +++ b/nixos/modules/services/desktops/flatpak.nix @@ -7,6 +7,8 @@ let cfg = config.services.flatpak; in { meta = { + # Don't edit the docbook xml directly, edit the md and generate it: + # `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` doc = ./flatpak.xml; maintainers = pkgs.flatpak.meta.maintainers; }; diff --git a/nixos/modules/services/desktops/flatpak.xml b/nixos/modules/services/desktops/flatpak.xml index a6d27e40b0a3..3a4cfc5ea403 100644 --- a/nixos/modules/services/desktops/flatpak.xml +++ b/nixos/modules/services/desktops/flatpak.xml @@ -1,56 +1,57 @@ - - Flatpak - - Source: - modules/services/desktop/flatpak.nix - - - Upstream documentation: - - - - Flatpak is a system for building, distributing, and running sandboxed desktop - applications on Linux. - - - To enable Flatpak, add the following to your - configuration.nix: - + + Flatpak + + Source: + modules/services/desktop/flatpak.nix + + + Upstream documentation: + https://github.com/flatpak/flatpak/wiki + + + Flatpak is a system for building, distributing, and running + sandboxed desktop applications on Linux. + + + To enable Flatpak, add the following to your + configuration.nix: + + services.flatpak.enable = true; - - - 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 - configuration.nix: - + + 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 + configuration.nix: + + xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ]; - - - Then, you will need to add a repository, for example, - Flathub, - either using the following commands: - -$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo -$ flatpak update - - or by opening the - repository - file in GNOME Software. - - - Finally, you can search and install programs: - -$ flatpak search bustle -$ flatpak install flathub org.freedesktop.Bustle -$ flatpak run org.freedesktop.Bustle - - Again, GNOME Software offers graphical interface for these tasks. - + + Then, you will need to add a repository, for example, + Flathub, + either using the following commands: + + +$ flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +$ flatpak update + + + or by opening the + repository + file in GNOME Software. + + + Finally, you can search and install programs: + + +$ flatpak search bustle +$ flatpak install flathub org.freedesktop.Bustle +$ flatpak run org.freedesktop.Bustle + + + Again, GNOME Software offers graphical interface for these tasks. +