Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug | Home Manager Module | Flatpaks Fail to Launch When Only Home Manager Module is Installed #33

Open
ReedClanton opened this issue Feb 1, 2024 · 5 comments
Labels
documentation Improvements or additions to documentation upstream issue Issue related to an upstream compoment

Comments

@ReedClanton
Copy link
Contributor

ReedClanton commented Feb 1, 2024

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

  1. Start from a fresh system that's never had flatpak, any flatpak application, or any nix-flatpak module installed.
  2. Run sudo nixos-rebuild switch --flake <pathToFlake> with only the Home Manager module of nix-flatpak installed.
  3. Install com.github.tchx84.Flatseal, cc.arduino.IDE2, and com.valvesoftware.Steam via nix-flatpak's Home Manager module.
  4. Launch Flatseal with flatpak run --user com.github.tchx84.Flatseal and verify that it launches as it should. This is an example of a flatpak that functions as it should.
  5. Launch Arduino IDE 2 with flatpak run --user cc.arduino.IDE2 and 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)
  1. Launch Arduino IDE 2 again with the same command and verify that it exhibits the same behavior.

  2. Launch Steam with flatpak run --user com.valvesoftware.Steam and 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
  1. Launch Steam again with the same command and verify that it now launches.
  2. Install the NixOS module of nix-flatpak along with a flatpak. For example, ASCii Draw (io.github.nokse22.asciidraw).
  3. Launch ASCii Draw and verify it works.
  4. 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 flatpak/flatpak#5488. Once that's resolved, this can be re-tested.

@gmodena
Copy link
Owner

gmodena commented Feb 5, 2024

Hey @ReedClanton,

Trying to replicate this bug.
Are you using HomeManager standalone, or as a NixOs module?

@ReedClanton
Copy link
Contributor Author

@gmodena as a NixOS module. Here's my config.

@gmodena
Copy link
Owner

gmodena commented Feb 10, 2024

I was able to reproduce.

To me is sounds very much similar to the issue reported in flatpak/flatpak#5488 (that also mentions Steam).

@gmodena
Copy link
Owner

gmodena commented Feb 10, 2024

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

@ReedClanton
Copy link
Contributor Author

@gmodena Yup, that looks like the same issue...

@gmodena gmodena added documentation Improvements or additions to documentation upstream issue Issue related to an upstream compoment labels Feb 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation upstream issue Issue related to an upstream compoment
Projects
None yet
Development

No branches or pull requests

2 participants