Flatpak: Difference between revisions

Malix (talk | contribs)
headings
Malix (talk | contribs)
move part to proper section
Line 7: Line 7:
=== Global ===
=== Global ===
Using this configuration, <code>flatpak</code> will be installed and ready to use globally for all users:
Using this configuration, <code>flatpak</code> will be installed and ready to use globally for all users:
{{file|3=services.flatpak.enable = true;|name=/etc/nixos/configuration.nix|lang=nix}}To automatically configure a flatpak repository for all users using the global configuration file, add this to your <code>configuration.nix</code> file:{{file|3=systemd.services.flatpak-repo = {
{{file|3=services.flatpak.enable = true;|name=/etc/nixos/configuration.nix|lang=nix}}
    wantedBy = [ "multi-user.target" ];
    path = [ pkgs.flatpak ];
    script = ''
      flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
    '';
  };|name=/etc/nixos/configuration.nix|lang=nix}}
 
=== Per-User ===
=== Per-User ===
If you'd rather make Flatpak available to a specific user, add <code>flatpak</code> to that user's packages. To be able to install Flatpaks graphically, add the <code>gnome-software</code> package. The result will look something like this:
If you'd rather make Flatpak available to a specific user, add <code>flatpak</code> to that user's packages. To be able to install Flatpaks graphically, add the <code>gnome-software</code> package. The result will look something like this:
Line 56: Line 49:
To manage Flatpak imperatively, you can use [https://docs.flatpak.org/en/latest/using-flatpak.html the <code>flatpak</code> CLI] ([https://docs.flatpak.org/en/latest/flatpak-command-reference.html <code>flatpak</code> CLI Reference Documentation])
To manage Flatpak imperatively, you can use [https://docs.flatpak.org/en/latest/using-flatpak.html the <code>flatpak</code> CLI] ([https://docs.flatpak.org/en/latest/flatpak-command-reference.html <code>flatpak</code> CLI Reference Documentation])


===== Example =====
==== Example ====
<syntaxhighlight lang="console">$ flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
<syntaxhighlight lang="console">$ flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
$ flatpak update
$ flatpak update
$ flatpak search Flatseal
$ flatpak search Flatseal
$ flatpak install flathub com.github.tchx84.Flatseal
$ flatpak install flathub com.github.tchx84.Flatseal
$ flatpak run com.github.tchx84.Flatseal</syntaxhighlight>
$ flatpak run com.github.tchx84.Flatseal</syntaxhighlight>To automatically configure Flatpak repositories for all users, this needs to be added to <code>configuration.nix</code>:{{file|3=systemd.services.flatpak-repo = {
    wantedBy = [ "multi-user.target" ];
    path = [ pkgs.flatpak ];
    script = ''
      flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
    '';
  };|name=/etc/nixos/configuration.nix|lang=nix}}


== Development ==
== Development ==