I’ve been struggling with NixOS and these bug reports have some of the gory details:
- Workrave: Installed GNOME extension does not work with current GNOME shell · Issue #420671 · NixOS/nixpkgs · GitHub
- pydbus: Broken, complains "cannot import name Gio, introspection typelib not found" on import · Issue #420899 · NixOS/nixpkgs · GitHub
Pretty much all the problems I’ve had involve apps looking for resources (e.g., typelib files, schemas) in some path, not being able to find them, and then breaking in seemingly inscrutable ways, either involving an error message to decipher or, worse, a crash. They’re problems that by and large disappear when the FHS is used.
I’ll lay out some of the details of the problems, and then ask about solutions.
With the Workrave package, the problem is twofold. First, it has a GNOME extension that isn’t patched to point to the correct typelib files, and even the patched extension will crash the GNOME shell unless XDG_DATA_DIRS
contains a path for Workrave’s gsettings schema files.
The other big problem I’ve had has been Python scripts that use D-Bus via either the pydbus or dasbus modules. (Those scripts are used with Workrave, FWIW). So far, the way I’ve gotten the scripts to work is to run them like this:
GI_TYPELIB_PATH=/nix/store/bkpj51fz88rbyjd60i6lrp0xdax1b24g-glib-2.84.1/lib/girepository-1.0 my_script.sh
Obviously, that’s a temporary hack meant as a proof of concept. FYI, I’ve installed the pydbus and dasbus packages by adding
(python3.withPackages (python-pkgs: with python-pkgs; [
pydbus
]))
to environment.systemPackages
.
I’m hoping that there has to be some sane, “canonical” way to get the environments straightened out, but I don’t know what it is. What’s the smart way to set XDG_DATA_DIRS
to include the correct directories? How to get pydbus and dasbus to find where Glib’s typelib files are located? Is the situation quite as dire as described at this post?:
I would hope that this isn’t the whole story, because it would imply that NixOS is designed to break certain apps so that they can’t provide their desired functionality without clumsy interventions.
Or is there a general Nix way of getting the environments set appropriately, so I can avoid frustrations like this in the future?