gmodena / nix-flatpak

Install flatpaks declaratively
Apache License 2.0
276 stars 10 forks source link

Bug | Home Manager Module | Desktop Environment Icons #31

Open ReedClanton opened 7 months ago

ReedClanton commented 7 months ago

Description

When flatpaks are installed via the Home Manager module, Desktop Environment icons don't appear. The applications are installed under ~/.local/share/flatpak/app, and can be launched from the terminal.

Launch Output

Output when flatpaks are launched via the terminal:

Note that the directories 

'/var/lib/flatpak/exports/share'
'/home/reedclanton/.local/share/flatpak/exports/share'

are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.

Temporary Fix

Add the bellow to your Home Manager configuration:

xdg.systemDirs.data = [
    "/var/lib/flatpak/exports/share"
    "/home/<userName>/.local/share/flatpak/exports/share"
];

Reproduce

  1. Fresh NixOS install w/ Gnome done with the provided NixOS GUI installer.
  2. Only install the Home Manger nix-flatpak module.

My nix-flatpak Nix File

{ nix-flatpak, pkgs, user, ... }: {
        home.packages = with pkgs; [ flatpak ];

        services.flatpak = {
                enable = true;
                packages = [ { appId = "com.github.tchx84.Flatseal"; origin = "flathub"; } ];
                # TODO: Troubleshoot why adding a remote prevents flatpak install and add issue to nix-flatpak github.
#               remotes = [{
#                       name = "flathub-beta";
#                       location = "https://flathub.org/beta-repo/flathub-beta.flatpakrepo";
#               }];
                update = {
                        auto.enable = true;
                        onActivation = true;
                };
        };

#       xdg.systemDirs.data = [
#               "/var/lib/flatpak/exports/share"
#               "${user.home}/.local/share/flatpak/exports/share"
#       ];
}