NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.42k stars 13.63k forks source link

Enabling dconf doesn't create /etc/dconf/db #85546

Open magnetophon opened 4 years ago

magnetophon commented 4 years ago

Describe the bug When I put dconf.enable = true; in my config, rebuild and reboot, dconf doesn't work: failed to commit changes to dconf: The connection is closed. When I run dconf update I get error: Error opening directory “/etc/dconf/db”: No such file or directory. The directory indeed doesn't exist. When I create it manually, (and run dconf update, not sure if that's needed), dconf works. I'm not running any desktopmanager, just i3.

To Reproduce Steps to reproduce the behavior:

  1. put dconf.enable = true; in your config
  2. rebuild
  3. reboot

Expected behavior Programs using dconf should be able to commit changes when you enable it.

Notify maintainers @hedning @jtojnar @worldofpeace

Metadata

hedning commented 4 years ago

Programs running as the main user will use a db in the home directory, not the system one (~/.config/dconf/user). Are you seeing a service fail to commit changes? In that case the service might need a dconf profile ala. ibus and gdm.

jtojnar commented 4 years ago

I find it curious that the system db is needed. Quoting from the dconf manual:

If the DCONF_PROFILE environment variable is unset and the "user" profile can not be opened, then the effect is as if the profile was specified by this file:

user-db:use

That is, the user's personal database is consulted and there are no system settings.

Though, I think running dconf update when /etc is built would be nice so we could create dconf databases using environment.etc until #54150 is implemented.

magnetophon commented 4 years ago

Are you seeing a service fail to commit changes?

I was trying to get https://github.com/NixOS/nixpkgs/pull/85553 to work.

In that case the service might need a dconf profile ala. ibus and gdm.

I found https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/i18n/input-method/ibus.nix#L67 and https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/x11/display-managers/gdm.nix#L248 but I'm not sure how to proceed.

@jtojnar idk, I'm totally new to dconf; just going by the error messages.

stale[bot] commented 3 years ago

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.