Easy way to add paths to GI_TYPELIB_PATH?

I’d like to install a GNOME Shell extension (via extensions.gnome.org) which relies on some libraries. The extension communicates to said libraries via GObject introspection. The problem is that even though those libraries are installed on stock NixOs, their girepository paths are not among paths in GI_TYPELIB_PATH env variable. Is there a convenient way to add those paths without adding them one by one manually?

That is not really how NixOS works – installing libraries globally is not supported: FAQ - NixOS Wiki

If you want to install GNOME Shell extension that depends on libraries or programs, you need to install it from Nixpkgs. Unfortunately, some manual work will likely still be required at the moment – although, we now should have most compatible extensions from the portal packaged, we still need gnomeExtensions: add patch framework and fix extensions by piegamesde · Pull Request #137131 · NixOS/nixpkgs · GitHub to allow patching the extensions without packaging them manually.

2 Likes

Could you shed some light please on what manual work would involve? For example, the extension depends on evolution-data-server package which is available in nix store. Can I write a patch to make the package available for the extension (including the GObject introspection data)? How about editing environment.systemPackages in /etc/nixos/configuration.nix?

Once gnomeExtensions: add patch framework and fix extensions by piegamesde · Pull Request #137131 · NixOS/nixpkgs · GitHub is merged, you will be able to patch the extensions just like the manually packaged ones NixOS - Nixpkgs 21.05 manual

1 Like