plasma/xfce/enlightenment: improve detection of application mime types for apps that use GIO (firefox)#44866
plasma/xfce/enlightenment: improve detection of application mime types for apps that use GIO (firefox)#44866michaelpj wants to merge 4 commits intoNixOS:masterfrom
Conversation
|
@vcunat perhaps, based on your comments on the issues? |
|
Looks fine. In the long run we should probably have freedesktop module that should handle this and be depended on by the DEs.
I guess the late binding is used to prevent introducing those utilities on servers/more lightweight systems. |
NixOS, i.e.
|
|
Apart from the future work discussion, I think this is good to go? |
|
Superseded by #45058. |
Motivation for this change
One the trail of #44849 (related #11355), I discovered that apps that use GIO use a slightly different (and possibly not standards compliant) way of finding mime types for applications.
One thing that came up was the presence of
share/applications/mimeinfo.cache, and lo and behold, this is not present using my DE.A bit of further tracking revealed that we do populate this using
update-desktop-database, but only if it happens to be present on the path (see https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/config/system-path.nix#L147).Adding this to
environment.systemPackagesfor plasma results in firefox now having file associations! They're still wrong (it opens pdfs in evince rather than okular, which is whatxdg-opensays it should use), but that's for another day.I added
desktop-file-utilsto the DEs that appear to be doing the same thing withshared-mime-info- I wasn't brave enough to touch the others.Separately, I'd like to talk about whether
system-path.nixis doing the right thing. It feels quite fragile to just be relying on the presence of these executables, and I don't know what would be lost by always running them (and referring to the packages directly). There's also the issue thatmimeinfo.cacheis missing from my profile'sshare/applications, and I'm not sure what should be responsible for building that.Things done
sandboxinnix.confon non-NixOS)nix-shell -p nox --run "nox-review wip"./result/bin/)nix path-info -Sbefore and after)