diff options
author | Robert Helgesson <robert@rycee.net> | 2020-03-09 23:25:45 +0100 |
---|---|---|
committer | Robert Helgesson <robert@rycee.net> | 2020-03-21 01:02:41 +0100 |
commit | 0f11a79e02711e79386f4761b1205ea4a8483aa8 (patch) | |
tree | f36a2b1a6d0911123e0a2f2ddb43ec40678fdef4 /modules/misc/dconf.nix | |
parent | ac9e44a8316afb8dbf5c6c961c3a3975e20d96b0 (diff) |
dconf: make `settings` have type `gvariant`
Closes #835, #1094, #1095
Diffstat (limited to 'modules/misc/dconf.nix')
-rw-r--r-- | modules/misc/dconf.nix | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/modules/misc/dconf.nix b/modules/misc/dconf.nix index f5c9bf71456..fbdc838301a 100644 --- a/modules/misc/dconf.nix +++ b/modules/misc/dconf.nix @@ -9,22 +9,7 @@ let toDconfIni = generators.toINI { mkKeyValue = mkIniKeyValue; }; mkIniKeyValue = key: value: - let - tweakVal = v: - if isString v then "'${v}'" - else if isList v then tweakList v - else if isBool v then (if v then "true" else "false") - else toString v; - - # Assume empty list is a list of strings, see #769 - tweakList = v: - if v == [] then "@as []" - else "[" + concatMapStringsSep "," tweakVal v + "]"; - - in - "${key}=${tweakVal value}"; - - primitive = with types; either bool (either int (either float str)); + "${key}=${toString (hm.gvariant.mkValue value)}"; in @@ -43,8 +28,7 @@ in }; settings = mkOption { - type = with types; - attrsOf (attrsOf (either primitive (listOf primitive))); + type = with types; attrsOf (attrsOf hm.types.gvariant); default = {}; example = literalExample '' { @@ -53,6 +37,7 @@ in show-thousands = true; base = 10; word-size = 64; + window-position = lib.hm.gvariant.mkTuple [100 100]; }; } ''; |