Conversation
This provides global access to the gsettigs schemas of installed packages.
jtojnar
left a comment
There was a problem hiding this comment.
The patch looks fine to me. However, I am still not convinced that this is the way to go. In my opinion, purity is one of the main benefits of Nix and I would like to push it beyond practicality – for example I was recently contemplating a setup hook that would patch C source code replacing g_settings_new with g_settings_schema_source_new_from_directory+g_settings_schema_source_new_from_directory+g_settings_new_full.
| environment.systemPackages = pkgs.gnome3.corePackages ++ cfg.sessionPath | ||
| ++ (removePackagesByName pkgs.gnome3.optionalPackages config.environment.gnome3.excludePackages) ++ [ | ||
| pkgs.xdg-user-dirs # Update user dirs as described in http://freedesktop.org/wiki/Software/xdg-user-dirs/ | ||
| pkgs.gnome3.mutter # Give eg. gnome-control-center access to schema |
There was a problem hiding this comment.
IIRC, mutter was required by g-c-c for keyboard panel, not schemas.
There was a problem hiding this comment.
It fetches (and sets) the keybindings from mutters schema. I can make the comment explicit that it's the keyboard panel functionality that require them.
There was a problem hiding this comment.
Oh, right. The keybindings XML files point to schemas. I think I have somewhere g-c-c patch that adds schemafile argument to KeyListEntries element from the time I wanted to get rid of sessionPath.
Co-Authored-By: hedning <torhedinbronner@gmail.com>
|
I share the opinion of @jtojnar, while it is annoying at first to add these wrappers to nixpkgs say are more robust in the end then the situation we have with qt, where one can no longer run applications from nix-shell due missing paths in the profile. |
|
I should've made the motivation clearer. Run time dependencies should still be handled by wrappers, patching the source, or by automatically hardcoding paths like @jtojnar alluded to (if we could fix this in glib that would be really great). This PR isn't meant to address those issues. This is meant to address optional run time dependencies on schemas. Perhaps best exemplified by So while we all agree it's pretty poor design to pick up build times dependencies from the global environment. It's actually sometimes used correctly to pick up optional run time dependencies. Solving this at build time isn't really approriate as it will bloat closures and will never be complete. |
|
Well, schemas are almost never optional dependency. We can almost always either wrap the program, or replace
I already have somewhat messy patch for the first one and the second one should not be that big of a problem either.
|
|
Actually, I already wrote the introspection code #33277 (comment), we only need to replace |
Nice, that would be a better solution (at least if the performance is okay) 👍. As you said, it's not a very common pattern (though not having access to through I'll close this in favor of your suggested solution. |
|
For the record, |
We shouldn't need to use wrapGAppsHook in expressions that use this builder. The code to do this is from NixOS#54083.
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: |
Motivation for this change
Provide global access to gsettings schemas of installed packages.
resolves #19590
resolves #54082
Will also help with various plugins that's picked up from the global environment, but which doesn't expose its own gsettings schemas properly (eg. #42176)
Things done
Running with this on my machine right now.