I am trying to configure my gnome3 desktop from configuration.nix.
In particular, I would like to set the theme and the background image. I guess that if this works, then I can do more
Oh, awesome! It means that my settings are going to be applied when I configure the machine for the first time, right?
What would be the way of testing it? Nuke something from my home directory?
You can use dconf Editor (gnome3.dconf-editor) to easily nuke individual settings to test.
As an alternative, you can also use home-manager’s dconf.settings module (docs); this is per-user, but will actually reset existing keys when you run home-manager switch. home-managercan be integrated into your configuration.nix as a module; I presume that things like dconf.settings work similarly in this case, but I’ve never used the module functionality myself so I’m not 100% sure.
FWIW, using home-manager’s dconf.settings module to configure Pantheon is exactly how I handle things. Here’s the relevant file from my “dotfiles” (that repo is a bit of a work-in-progress right now).
The only problem I’ve run into is that /org/gnome/settings-daemon/plugins/color/night-light-temperature expects an unsigned 32-bit INT, but home-manager inserts a signed 32-bit INT… Which then gets promptly ignored. But as you can tell from the path, this is actually a GNOME component that Pantheon’s re-using, and the deficiency is technically in home-manager anyway (I’ve run into a few other similar issues).
Thank you! I have basically every dcofig setting working after looking at your configs. However, I can’t get the “miller_columns” configuration to work (the three column view in Files).
A lot of per-application schemas on NixOS show the No schema found note. I think this is because of how Nix handles applications files, and I’ve rarely run into any problems this approach causes (though thismight be an exception).
I did some experimentation around the default-viewmode for Files, and can reproduce your issue. It looks like the reason for this is that setting default-viewmode isn’t sufficient in and of itself; tab-info-list also needs to be set (you can see this second key change after switching the view mode in Files and then closing the window). Digging around in Files… well… files reveals that tab-info-list is a tuple with the following schema:
<key type="a(uss)" name="tab-info-list">
<summary>Details of open tabs</summary>
<default>[(0,'','')]</default>
<description>Array of tab info: View mode, root uri, tip uri (for Miller view)</description>
</key>
The “view mode” here corresponds to 0 for the icon view, 1 for the list view, and 2 for miller_columns. The two strings are of the form file:///path/to/directory, with the second string being empty for the icon and list views.
Unfortunately, home-manager can’t yet set dconf tuples (though there’s a pull request open to add this functionality), so it doesn’t look like File’s view mode can be fully set yet.