The XDG Desktop Entry spec mentions that multiple values per key may be
optionally terminated by a semicolon. An example for this is the Firefox
desktop file, which has no trailing semicolon. This breaks the sed regex
used in `mimeAssociations`.
Fix the regex by matching the end of string, optionally preceded by a
semicolon, or any other semicolon. This makes it work with both
semicolon-terminated and non-semicolon-terminated desktop files.
This convenience function allows automatic assignment of a package's
associations to `xdg.mimeApps.defaultApplications`.
For example,
xdg.mimeApps.defaultApplications =
config.lib.xdg.mimeAssociations [ pkgs.gnome.evince ];
Co-authored-by: Ryan Trinkle <ryan@trinkle.org>
Before, loading a module would be guarded by an optional platform
condition. This made it possible to avoid loading and evaluating a
module if it did not support the host platform.
Unfortunately, this made it impossible to share a single configuration
between GNU/Linux and Darwin hosts, which some wish to do.
This removes the conditional load and instead inserts host platform
assertions in the modules that are platform specific.
Fixes#1906