The first, desktop-icons@csoriano, builds fine, but Gnome Tweaks reports “error loading extension” and I can’t find any relevant logs to explain why.
Syncthing Icon
The second, syncthingicon@jay.strict@posteo.de, installs and runs perfectly, except when I attempt to launch the Syncthing web Interface from the extension’s menu. When I do that, it fails with:
gjs[23339]: JS ERROR: Error: Requiring WebKit2, version none: Typelib file for namespace ‘WebKit2’ (any version) not found
From what I can tell, clicking the “Web Interface” button invokes gjs to load webviewer.js, which attempts to import WebKit2.
I suspect I need to modify the environment when gjs is spawned so that imports.gi.WebKit2 can be found, but I’m not sure how to do that with Glib spawning functions , or what variables control the gobject-introspection search path. Help?
Since discourse ML support is borked for me, I am reposting through the web UI:
gobject-introspection obtains the paths from GI_TYPELIB_PATH environment variable, see doc: add GNOME by jtojnar · Pull Request #43150 · NixOS/nixpkgs · GitHub. And while you could replace the null argument with environment array in the spawn_async, it is probably cleaner to modify the lookup path in the target source file directly. We are already doing that in some extensions:
Mar 11 10:43:07 nixos .gnome-shell-wr[1007]: Extension "desktop-icons@csoriano" had error: Error: Schema org.gnome.shell.extensions.desktop-icons could not be found for extension desktop-icons@csoriano. Please check your installation.
The extension expect the schemas somewhere in $XDG_DATA_DIRS/share/glib-2.0/schemas, whereas our glib setup hook moves it to $out/share/gsettings-schemas/$name/glib-2.0/schemas to avoid conflicts.