From 0b4ec66640ad5a1aa912a2ae7643f9756e71b4a7 Mon Sep 17 00:00:00 2001 From: Jan Tojnar Date: Sat, 6 May 2023 17:26:35 +0200 Subject: [PATCH] dconf: Warn about strict typing of options This is a frequent surprise to users. --- modules/misc/dconf.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/modules/misc/dconf.nix b/modules/misc/dconf.nix index f1ce38d3..8aa8e8d8 100644 --- a/modules/misc/dconf.nix +++ b/modules/misc/dconf.nix @@ -59,6 +59,17 @@ in { ''; description = '' Settings to write to the dconf configuration system. + + Note that the database is strongly-typed so you need to use the same types + as described in the GSettings schema. For example, if an option is of type + uint32 (u), you need to wrap the number + using the lib.hm.gvariant.mkUint32 constructor. + Otherwise, since Nix integers are implicitly coerced to int32 + (i), it would get stored in the database as such, and GSettings + might be confused when loading the setting. + + You might want to use dconf2nix + to convert dconf database dumps into compatible Nix expression. ''; }; };