Flatpak in 23.05 # error: The name org.freedesktop.Flatpak.SystemHelper was not provided by any .service files

  • system: "x86_64-linux"
  • host os: Linux 6.1.34, NixOS, 23.05 (Stoat), 23.05.1092.c7ff1b9b956
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.13.3
  • channels(root): "nixgl, nixos-23.05, nixos-hardware"
  • channels(usera): ""
  • nixpkgs: /nix/var/nix/profiles/per-user/root/channels/nixos

https://nixos.wiki/wiki/Flatpak

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
error: The name org.freedesktop.Flatpak.SystemHelper was not provided by any .service files
flatpak remotes
error: While opening repository /var/lib/flatpak/repo: opening repo: opendir(/var/lib/flatpak/repo): No such file or directory

Well how does your config look like?

I’ve set up mine like this and it still works on 23.05:

services.flatpak.enable = true;
users.users.a = { packages = with pkgs; [ flatpak gnome.gnome-software ]; };
  xdg = {
    portal = {

    enable = true ;
    xdgOpenUsePortal = true ;
    extraPortals = ( with pkgs;  [
      libsForQt5.xdg-desktop-portal-kde
      xdg-desktop-portal
      xdg-desktop-portal-gtk
     ] ) ; 
    };
  };

(it was working fine before the upgrade to 23.05 in 22.11)

Yeah looks good to me, maybe systemctl status flatpak-system-helper.service shows something?

Or maybe flatpak repair helps:

flatpak --version
Flatpak 1.14.4
systemctl status flatpak-system-helper.service
Unit flatpak-system-helper.service could not be found.

Something is quite broken on your end you should see this:

~ ❯ systemctl status flatpak-system-helper.service
○ flatpak-system-helper.service - flatpak system helper
     Loaded: loaded (/etc/systemd/system/flatpak-system-helper.service; linked; preset: enabled)
     Active: inactive (dead)
~ ❯

Maybe try to comment out the config, rebuild, add the config again and rebuild again?
Other than that I’m out of ideas.

Having the same issue. The full error report is:

❯ flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo

Note that the directories 

'/var/lib/flatpak/exports/share'
'/home/zmrocze/.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.

error: The name org.freedesktop.Flatpak.SystemHelper was not provided by any .service files

and similarly no systemd service

❯ systemctl status flatpak-system-helper.service
Unit flatpak-system-helper.service could not be found.

omg…

looks like going into 23.05 or earlier some service was added to flatpak/removed from nixos module and that service is now not spawned by systemd