GNOME software center (flatpak support)

Is it possible to install the GNOME Software Center on Guix? Almost all of the apps I use are Flatpaks and normally I install them through Software Center. (There are no Guix packages for these apps.)

I enabled Flatpak on my Guix system by entering these commands: Flatpak—the future of application distribution

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

But it seems like apps installed via flatpak --user aren’t integrated into the desktop launcher like apps from guix install are.

Is there any configuration I could add to improve the flatpak experience on Guix?

1 Like

I think you will be better of with nixos if you want to do that kind of thing, read more here Flatpak - NixOS Wiki. Guix is not so well integrated with flatpak and also I think that is not the intention anyway.

1 Like

Oh, I found out I was missing some configuration.

So first I need to install flatpak, like their docs say.

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

Then to install apps, I need to run this. The --user flag is important.

flatpak install --user flathub com.logseq.Logseq

You also need to update XDG_DATA_HOME so that it includes Flatpak directories. There is a file Flatpak provides that can do this. The file is located at ~/.guix-profile/etc/profile.d/flatpak.sh. You need to run the commands in flatpak.sh. There’s a bunch of ways of doing this.

I decided to copy the contents of flatpak.sh into my ~/.bash_profile. Apparently, GDM (or GNOME?) reads this file when you’re logging in.

However, I didn’t copy flatpak.sh by hand. I used guix home of course. Here’s what my home.scm file looks like.

(use-modules (gnu home)
             (gnu home services shells)
             (guix gexp)
             (gnu services))

(home-environment
  (services
    (list
      (service home-bash-service-type
               (home-bash-configuration
                (bash-profile (list (local-file
                                     (string-append (getenv "HOME") "/.guix-profile/etc/profile.d/flatpak.sh")
                                     "flatpak.sh")))))
      )))

Alternatively, you can extend ~/.profile, instead of using ~/.bash_profile.

(use-modules (gnu home)
             (gnu home services shells)
             (guix gexp)
             (gnu services))

(home-environment
  (services
    (list
      (simple-service 'flatpak-service
                      home-shell-profile-service-type
                      (list (local-file
                              (string-append (getenv "HOME") "/.guix-profile/etc/profile.d/flatpak.sh")
                              "flatpak.sh"))))))

Then I ran guix home reconfigure home.scm and rebooted my system just to be sure.

After all of that, the Flatpak apps now appear in GNOME’s app launcher! :partying_face:


The only thing left to address is running the GNOME Software Center GUI app… aaand this I’m not sure about. The original Flatpak link says:

Note: graphical installation of Flatpak apps may not be possible with GNU Guix.

So… maybe this isn’t possible now? I’m totally fine with using install --user to install apps.

2 Likes

well done on solving this :slight_smile: