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
Feature request: index by mime associations #702
Comments
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/index-nix-applications-packages-by-mime-associations/35725/3 |
Related: NixOS/nixpkgs#15932 |
How about an attrset in meta that maps mime types to programs? {
name = "foobar";
meta = {
mainProgram = "foo";
mimeHandlers = {
"application/x-foo" = "foo";
"x-scheme-handler/urn:foo" = "foo";
"application/x-bar" = "bar";
};
};
} I don't think any of the Gnome/Freedesktop stuff is useful here as we have to build the package to get those artifacts and they are anyway too complicated or too biased to Gnome. |
We do something similar with
The whole purpose of AppStream and Freedesktop.org Desktop Entry Specification is to have a single standard metadata format for description of software components and application launchers respectively. (Not sure why you are bringing up GNOME when GNOME is just one of the many parties involved.) With NixOS/rfcs#146, we appear to be trending towards reimplementing a subset of the specifications. For this purpose, we could even just use desktop files which are pretty simple to parse, and then cache them using something like nix-index. Yeah, there are a few more moving parts than with plopping increasingly more metadata into the expressions (we would probably need hydra support for it to be efficient) but we will probably want the other features of NixOS/nixpkgs#15932 for search as well. Is there really the need to have that data available at evaluation time? Is the need sufficient to justify the costs? It might be but we should consider it carefully, just like we do with NixOS/rfcs#146. |
Those standards only describe things in the context of a full-blown cargo-cult desktop with heaps of assumptions about wonky stuff like dbus. You don't need to look any further than the ".desktop" extension.
Yes, the tradeoff is the cost of evaluating To be fair what I've proposed isn't sufficient as you probably need to support command line flags and parameter substitutions. |
nixpkgs, even without flakes, has a lot of packages.
this might make it somewhat daunting for users to find what they need.
now, fortunately nix packages follow a fairly regular structure, placing e.g.
.desktop
files in a package's$out/share/applications
.this makes me wonder: if such a desktop file knows what mime types it applies to, might it not make sense to index the nixpkgs offering by these?
ideally, given an arbitrary file or scheme, this might make it easier for users to find software packages they could use these with.
(cross-posted as per @fricklerhandwerk's suggestion.)
The text was updated successfully, but these errors were encountered: