mirror of
https://github.com/nix-community/home-manager
synced 2024-11-23 11:39:46 +01:00
parent
ac9e44a831
commit
0f11a79e02
1 changed files with 3 additions and 18 deletions
|
@ -9,22 +9,7 @@ let
|
||||||
toDconfIni = generators.toINI { mkKeyValue = mkIniKeyValue; };
|
toDconfIni = generators.toINI { mkKeyValue = mkIniKeyValue; };
|
||||||
|
|
||||||
mkIniKeyValue = key: value:
|
mkIniKeyValue = key: value:
|
||||||
let
|
"${key}=${toString (hm.gvariant.mkValue value)}";
|
||||||
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));
|
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
|
@ -43,8 +28,7 @@ in
|
||||||
};
|
};
|
||||||
|
|
||||||
settings = mkOption {
|
settings = mkOption {
|
||||||
type = with types;
|
type = with types; attrsOf (attrsOf hm.types.gvariant);
|
||||||
attrsOf (attrsOf (either primitive (listOf primitive)));
|
|
||||||
default = {};
|
default = {};
|
||||||
example = literalExample ''
|
example = literalExample ''
|
||||||
{
|
{
|
||||||
|
@ -53,6 +37,7 @@ in
|
||||||
show-thousands = true;
|
show-thousands = true;
|
||||||
base = 10;
|
base = 10;
|
||||||
word-size = 64;
|
word-size = 64;
|
||||||
|
window-position = lib.hm.gvariant.mkTuple [100 100];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
|
|
Loading…
Reference in a new issue