plasma/xfce/enlightenment: improve detection of application mime types for apps that use GIO (firefox) #44866
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.systemPackages
for plasma results in firefox now having file associations! They're still wrong (it opens pdfs in evince rather than okular, which is whatxdg-open
says it should use), but that's for another day.I added
desktop-file-utils
to 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.nix
is 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.cache
is missing from my profile'sshare/applications
, and I'm not sure what should be responsible for building that.Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)