Bug | Home Manager Module | Flatpaks Fail to Launch When Only Home Manager Module is Installed
Description
Some flatpaks fail to launch when installed due to lacking access to /var/lib/flatpak/repo when they've been installed via nix-flatpak with the Home Manager module. This can be fixed by installing at least one flatpak system wide via the nix-flatpak NixOS module.
Reproduce
- Start from a fresh system that's never had
flatpak, any flatpak application, or anynix-flatpakmodule installed. - Run
sudo nixos-rebuild switch --flake <pathToFlake>with only the Home Manager module ofnix-flatpakinstalled. - Install
com.github.tchx84.Flatseal,cc.arduino.IDE2, andcom.valvesoftware.Steamvianix-flatpak's Home Manager module. - Launch Flatseal with
flatpak run --user com.github.tchx84.Flatsealand verify that it launches as it should. This is an example of a flatpak that functions as it should. - Launch Arduino IDE 2 with
flatpak run --user cc.arduino.IDE2and verify that it produces the bellow output, hangs, and fails to launch a GUI:
error: While opening repository /var/lib/flatpak/repo: opening repo: opendir(/var/lib/flatpak/repo): No such file or directory
[3 preload-host-spawn-strategy] Failed to let stub process know of exit: Bad file descriptor (errno 9)
-
Launch Arduino IDE 2 again with the same command and verify that it exhibits the same behavior.
-
Launch Steam with
flatpak run --user com.valvesoftware.Steamand verify that it produces the bellow output and exists (note, I think only the last line is relevant to this issue):
INFO:root:https://github.com/flathub/com.valvesoftware.Steam/wiki
ERROR:root:~/.steam/root isn't a symlink to an existing directory, cannot determine current prefix
INFO:root:Will set XDG dirs prefix to /home/reedclanton/.var/app/com.valvesoftware.Steam
INFO:migration:Copying /home/reedclanton/.var/app/com.valvesoftware.Steam/config to /home/reedclanton/.var/app/com.valvesoftware.Steam/.config, ignoring set()
INFO:migration:Renaming /home/reedclanton/.var/app/com.valvesoftware.Steam/config to /home/reedclanton/.var/app/com.valvesoftware.Steam/config.old
INFO:migration:Symlinking /home/reedclanton/.var/app/com.valvesoftware.Steam/config to .config
INFO:migration:Copying /home/reedclanton/.var/app/com.valvesoftware.Steam/.local/share to /home/reedclanton/.var/app/com.valvesoftware.Steam/.local/share.bak, ignoring {'Steam'}
INFO:migration:Copying /home/reedclanton/.var/app/com.valvesoftware.Steam/data to /home/reedclanton/.var/app/com.valvesoftware.Steam/.local/share, ignoring {'Steam'}
INFO:migration:Renaming /home/reedclanton/.var/app/com.valvesoftware.Steam/data to /home/reedclanton/.var/app/com.valvesoftware.Steam/data.old
INFO:migration:Symlinking /home/reedclanton/.var/app/com.valvesoftware.Steam/data to .local/share
INFO:migration:Copying /home/reedclanton/.var/app/com.valvesoftware.Steam/cache to /home/reedclanton/.var/app/com.valvesoftware.Steam/.cache, ignoring set()
INFO:migration:Renaming /home/reedclanton/.var/app/com.valvesoftware.Steam/cache to /home/reedclanton/.var/app/com.valvesoftware.Steam/cache.old
INFO:migration:Symlinking /home/reedclanton/.var/app/com.valvesoftware.Steam/cache to .cache
INFO:root:Restarting app due to finalize sandbox tuning
error: While opening repository /var/lib/flatpak/repo: opening repo: opendir(/var/lib/flatpak/repo): No such file or directory
- Launch Steam again with the same command and verify that it now launches.
- Install the NixOS module of
nix-flatpakalong with a flatpak. For example, ASCii Draw (io.github.nokse22.asciidraw). - Launch ASCii Draw and verify it works.
- Launch Arduino IDE 2 and verify that it now functions properly.
Note(s)
This issue occurs with other flatpaks, I've only chosen the above flatpak applications because they demonstrate the range of behaviors I seen when utilizing the Home Manager module of nix-flatpak.
Blocked By
@gmodena pointed out that this issue is a flatpak one. Thus this is blocked by https://github.com/flatpak/flatpak/issues/5488. Once that's resolved, this can be re-tested.
Hey @ReedClanton,
Trying to replicate this bug. Are you using HomeManager standalone, or as a NixOs module?
@gmodena as a NixOS module. Here's my config.
I was able to reproduce.
To me is sounds very much similar to the issue reported in https://github.com/flatpak/flatpak/issues/5488 (that also mentions Steam).
Under the hood the home-manager module will run flatpak with the --user switch.
I can repro the issue reported here by running the following on a clean install:
flatpak --user --noninteractive --no-auto-pin install flathub cc.arduino.IDE2
@gmodena Yup, that looks like the same issue...