1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2024-12-15 17:50:53 +00:00

xfconf: support uint (#3946)

This commit is contained in:
Guangqing Chen 2023-05-05 16:52:22 +08:00 committed by GitHub
parent f3824311a1
commit 38271ead8e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,8 +6,31 @@ let
cfg = config.xfconf; cfg = config.xfconf;
xfIntVariant = types.submodule {
options = {
type = mkOption {
type = types.enum [ "int" "uint" "uint64" ];
description = ''
To distinguish between int, uint and uint64 in xfconf,
you can specify the type in xfconf with this submodule.
For other types, you don't need to use this submodule,
just specify the value is enough.
'';
};
value = mkOption {
type = types.int;
description = "The value in xfconf.";
};
};
};
withType = v: withType = v:
if builtins.isBool v then [ if builtins.isAttrs v then [
"-t"
v.type
"-s"
(toString v.value)
] else if builtins.isBool v then [
"-t" "-t"
"bool" "bool"
"-s" "-s"
@ -55,9 +78,10 @@ in {
attrsOf (attrsOf (oneOf [ attrsOf (attrsOf (oneOf [
bool bool
int int
xfIntVariant
float float
str str
(listOf (oneOf [ bool int float str ])) (listOf (oneOf [ bool int xfIntVariant float str ]))
])) // { ])) // {
description = "xfconf settings"; description = "xfconf settings";
}; };