On NixOS 20, I installed calibre (via home-manager), and it worked perfectly. Since I have updated to NixOS 21, when I click on the “Add Book” button, it freezes for a few seconds, then crashes.
Here is the output:
/nix/store/fwzgpr17cjsp5c7ax8sr10dpcqvb93p6-glib-networking-2.68.1/lib/gio/modules/libgiognutls.so: undefined symbol: g_tls_channel_binding_error_quark
Failed to load module: /nix/store/fwzgpr17cjsp5c7ax8sr10dpcqvb93p6-glib-networking-2.68.1/lib/gio/modules/libgiognutls.so
[Click on "Add Button"]
(python:3141): Gtk-WARNING **: 09:29:34.794: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
**
Gtk:ERROR:../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /run/current-system/sw/share/icons/Adwaita/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Bail out! Gtk:ERROR:../gtk/gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /run/current-system/sw/share/icons/Adwaita/16x16/status/image-missing.png: Unrecognized image file format (gdk-pixbuf-error-quark, 3)
Aborted (core dumped)
I have googled this issue, and I have found that on other distros, the solution would simply be to run sudo update-mime-database /usr/share/mime
, but of course there is no such directory on NixOS. And, I also guess this should be part of some installation / update script, I shouldn’t have to run it.
To quote a maintainer of gtk-pixbuf
(the discussion):
The PNG loader not being found is a side effect of updating your system and the package manager not running
gdk-pixbuf-query-loaders
. Which is why re-generating theloaders.cache
(either directly or indirectly) fixes the issue.This has been solved by making the PNG loader built into the gdk-pixbuf shared library; in general, though, either you or your OS should rebuild the
loaders.cache
file every time gdk-pixbuf (or a package that provides a gdk-pixbuf shared module) is updated.
I guess in the case of NixOS, it should be the OS, but I might be wrong.
In any case, how can I fix this?