-
-
Notifications
You must be signed in to change notification settings - Fork 14.9k
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
nixos/flatpak: pass system icons and fonts #262462
Conversation
a340b18
to
0194ccc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not handle symlinks pointing to trees of symlinks (e.g. when using font collections produced with buildEnv
) but I am not sure how common that is.
I also wonder about performance with large font libraries. I thought about using nix-store --query --references
but that will not work for the /run/current-system
paths directly, since they are not in Nix store. It would also pull in all dependencies, not just those referenced by icons/fonts. But I guess we can just address it by having NixOS generate /run/current-system/sw/share/nix-flatpak/fonts.closure
if/when someone notices a performance degradataion.
Thanks for the review! I applied the suggestions.
I think it does, because |
I'm running this locally, it seems to work fine, at least for fonts (I can see my system fonts in Inkscape without the bindfs workaround). |
Does the bindfs workaround have the same behavior? If no, what is the output of |
b0fec33
to
b333f26
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After some restarts (maybe cleaning up the old /usr bindfs mounts), and checking again, this patch seems to be working fine. I can see fonts everywhere, and proper cursors in most apps (but a few stubborn gtk ones, but would not make an issue for them). LGTM
will this fix the mouse cursor not being the adwaita theme in flatpak apps? |
Yes |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/3158 |
since well this is still an open issue is passing themes as well out of the question |
I don't think flatpak tries to pass themes by default, just fonts and icons. I also don't know if nixpkgs would be willing to accept a patch to add a feature that doesn't exist on other distros like that? |
This is what I used to do on arch symlink th theme I want to use from /usr/share/.../themes it seems just installing the package isn't enough in nixos or home-manager since I have no idea where are the themes even stored Also so adding icon packs to .local/share/icons manually isn't gonna pass them ?? |
what is blocking this pr? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can confirm this fixes icons and fonts in Flatpak apps on my system. The changes also look sane to the extent I can say that without familiarity with glib code.
So this will get merged now ?? |
No, this has to be done by someone with commit rights. Please be more patient. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@SuperSandro2000 could you please give a look at this PR? I've been running it for months with great success. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works for me too!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but I have no clue about the C code :/
@andrevmatos can you post just the bit when you overrided the module with this pr |
@beh-10257 my system is a flake using https://github.com/gytis-ivaskevicius/flake-utils-plus, and I use the |
@ofborg build flatpak |
Fonts fine but icons are still missing. Edit: Install icon system-wide solve issue. |
How to apply this patch in nixos 23.11? |
Did not know this: NixOS/nixpkgs#262462
Fixes #119433
Description of changes
Add another patch to Flatpak that mounts the NixOS system font and icon directories into the sandbox if the standard FHS ones don't exist. The FHS paths are still checked so that the Flatpak build still works on non-NixOS systems. Since these directories contain symlinks into
/nix/store
, the patch also walks the tree of symlinks to collect a list of/nix/store
paths to expose to the sandbox.Also, change the default for
fonts.fontDir.enable
fromfalse
toservices.flatpak.enable
.Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)