Flatpak: Difference between revisions
imported>Tormeh m Fix typo where `:` was used in place of `=` |
imported>Tormeh Add instructions for how to enable flatpak on a single user rather than globally |
||
Line 3: | Line 3: | ||
== Usage == | == Usage == | ||
Using this configuration, <code>flatpak</code> will be installed and ready for use: | Using this configuration, <code>flatpak</code> will be installed and ready for use globally for all users: | ||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | {{file|/etc/nixos/configuration.nix|nix|<nowiki> | ||
services.flatpak.enable = true; | services.flatpak.enable = true; | ||
</nowiki>}} | </nowiki>}} | ||
After adding | If you'd rather make flatpak available on a specific user rather than globally, add <code>flatpak</code> to that user's packages. To be able to install flatpaks graphically, add the <code>gnome.gnome-software</code> package. The result will look something like this: | ||
{{file|/etc/nixos/configuration.nix|nix|<nowiki> | |||
users.users.myflatpakuser = { | |||
packages = with pkgs; [ | |||
flatpak | |||
gnome.gnome-software | |||
]; | |||
}; | |||
</nowiki>}} | |||
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 [https://nixos.wiki/wiki/Greetd greetd] login manager and [https://nixos.wiki/wiki/Sway Sway] create a <code>.profile</code> file with an override for your <code>XDG_DATA_DIRS</code> path, e.g.: | To manually add it to path while using a [https://nixos.wiki/wiki/Greetd greetd] login manager and [https://nixos.wiki/wiki/Sway Sway] create a <code>.profile</code> file with an override for your <code>XDG_DATA_DIRS</code> path, e.g.: | ||
Line 14: | Line 24: | ||
export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share | export XDG_DATA_DIRS=$XDG_DATA_DIRS:/usr/share:/var/lib/flatpak/exports/share:$HOME/.local/share/flatpak/exports/share | ||
</nowiki>}} | </nowiki>}} | ||
This is also required when installing <code>flatpak</code> on a per-user basis. | |||
To start using flatpaks, particularly for flatpak development: | To start using flatpaks, particularly for flatpak development: |