Flatpak: Difference between revisions

From NixOS Wiki
imported>Tormeh
(Add instructions for how to enable flatpak on a single user rather than globally)
imported>Onny
mNo edit summary
Line 37: Line 37:
</syntaxHighlight>
</syntaxHighlight>


== Issues ==
== Troubleshooting ==
 
=== Missing themes and cursors ===
 
If you have issues with cursors or themes in general, take a look at [https://nixos.wiki/wiki/Fonts#Flatpak_applications_can.27t_find_system_fonts Fonts]
If you have issues with cursors or themes in general, take a look at [https://nixos.wiki/wiki/Fonts#Flatpak_applications_can.27t_find_system_fonts Fonts]

Revision as of 10:16, 4 July 2023

Flatpak is a linux application sandboxing and distribution framework

Usage

Using this configuration, flatpak will be installed and ready for use globally for all users:

/etc/nixos/configuration.nix
services.flatpak.enable = true;

If you'd rather make flatpak available on a specific user rather than globally, add flatpak to that user's packages. To be able to install flatpaks graphically, add the gnome.gnome-software package. The result will look something like this:

/etc/nixos/configuration.nix
  users.users.myflatpakuser = {
    packages = with pkgs; [
      flatpak
      gnome.gnome-software
    ];
  };

After adding the desired solution to your configuration file, flatpak will be installed, however it is not always added to your path directly, e.g. when you are using sway it will be not.

To manually add it to path while using a greetd login manager and Sway create a .profile file with an override for your XDG_DATA_DIRS path, e.g.:

.profile
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share

This is also required when installing flatpak on a per-user basis.


To start using flatpaks, particularly for flatpak development:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak update
flatpak search bustle
flatpak install flathub org.freedesktop.Bustle
flatpak run org.freedesktop.Bustle

Troubleshooting

Missing themes and cursors

If you have issues with cursors or themes in general, take a look at Fonts