-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/dconf: Allow creating custom databases #54150
Comments
I'd think if someone declared a key in the module that they'd want it to not change. Though reading https://wiki.gnome.org/Projects/dconf/SystemAdministrators
So the lockdown feature needs improvement. |
I do not think that would be an obstacle to
It would be useful for things like setting the NixOS wallpaper, which we want to be overridable. |
So working from the code snippet from @jtojnar there would be two ways of specifying locks I think: programs.dconf.dbs.<name> = {
settings.<key> = "foo";
locks = [];
# Perhaps something like this too:
lock = false; # whether to lock all keys
}; or programs.dconf.dbs.<name>.<key> = {
value = "foo";
lock = true;
}; I don't think keys should be locked by default, as it's easy to revert keys back in eg. At that point we could build Not sure if there's much point in supporting more than one setting file per db? |
Initially, I was thinking about having options like Personally, I like your second example (with the possibility of using the value directly when not locking) better, since I do not need many locks and think that having them next to the key they are locking would be most clear. But I can imagine someone wanting to lock everything, which would not be very comfortable this way. Also note that GSettings values are typed so we might need to serialize arbitrary GVariants.
Perhaps if they came from a different source (network drive). I would not bother with that. What we probably do want is the ability to specify name of the |
Actually each database corresponds to a single binary file. (And possibly multiple source keyfiles in Hmm, using |
Was referring to the source keyfiles, I can't come up with a reason to support more than one either. |
It does look cleaner, and perhaps optimal if we support strings and attrsets.
It looks like the keyfiles use the schema path, not id. Ie. |
Yeah, just realized that. dconf works on lower level so it cannot translate the ids. The benefit is that the keys are no longer demarcated. |
There is now a pull request to create a dconf db in GDM module. If we could just generalize this. |
Re: Per-value locks and mass-lock tedium: In the unlikely event that many locks are needed this seems easy enough to handle with |
Please keep in mind list-valued configuration: Dconf does not support merging list-valued keys. At least two important Gnome settings are list-valued: |
Yet another issue caused by In the light of this and other issues like I would like to base the new options on top of NixOS/rfcs#42 but its custom writer story needs to be improved first in order to allow us to implement the full support for I think the locks could be implemented on NixOS module level using something like |
using the formats.ini gets us close to making keyfiles (imo its fine like this afaik but we need to add settings = {
"org/gnome/settings-daemon/plugins/power" = {
sleep-inactive-ac-type = "'nothing'";
};
};
{ lib, stdenv, formats }:
let
settings = {
"org/gnome/settings-daemon/plugins/power" = {
sleep-inactive-ac-type = "'nothing'";
};
};
settingsFormat = formats.ini { };
configFile = settingsFormat.generate "custom.conf" settings;
in
stdenv.mkDerivation rec {
pname = "something";
version = "0.0.1";
src = configFile;
dontUnpack = true;
installPhase = ''
cp ${src} $out
'';
} |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/desync-between-scalling-governeror-and-gnome-power-profile/16387/1 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/the-keyboard-layout-does-not-change-after-modifying-config/16666/14 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/linux-accessibility-an-unmaintained-mess/19126/4 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/need-help-for-nixos-gnome-scaling-settings/24590/5 |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/making-nixos-more-user-friendly-whats-needed/25567/6 |
This comment was marked as duplicate.
This comment was marked as duplicate.
Since #234615 has been merged, can this be closed? What's the next step? Should we deprecate |
Fixed by #234615 |
Not reflected in the https://nixos.org/manual/nixos/unstable/#sec-gnome-gsettings-overrides?
|
Yes. I think deprecating extraGSettingsOverrides is the goal. From my understanding |
One thing that Deprecation will also include writing docs. |
GLib’s GSettings system stores application settings in one of supported backends and uses compiled schemas (located in
$XDG_DATA_DIRS/glib-2.0/schemas/gschemas.compiled
) to determine type and default value of configuration keys. The schemas are compiled from XML files provided by applications and optionally, the default value can be changed by overrides.Current situation
At the moment, we use GSettings overrides to declaratively change settings for GNOME & co., relying on the overridden default value. While this is great for non-important things like distribution-default background image, it suffers from many problems and inconveniences:
XDG_DATA_DIRS
on first come, first served basis, we need to make sure our overrides are first in the chain. This is only possible by patching GLib.NIX_GSETTINGS_OVERRIDES_DIR
environment variable to applications is fragile. It does not really work for things like display managers, resulting in issues like GNOME keeps suspending on unstable #42053extraGSettingsOverrides
option needs to be written in keyfile syntax, it would be much more convenient if we could use Nix syntax.The goal of this issue is to attack the problem from the other side: modifying the backend.
Going through the backend
On Linux, the dconf backend is commonly used. It will select a profile pointing to a list of binary databases that are used for retrieving settings, see its overview for the gory details. Since the database is binary, the attrsets serialized into keyfiles will need to be compiled with
dconf compile
Our dconf module can create profiles, which GDM module is incorrectly taking advantage of. In order to be able to configure application declaratively, we would also need to generate keyfiles and compile them to databases.
We probably do not want people to have to spell everything out
It is not clear to me how should we handle locking – do we allow users to change the keys set through the module? Do we add lock control in the module?
Interesting links
cc @worldofpeace @hedning
The text was updated successfully, but these errors were encountered: