mirror of
https://github.com/nix-community/home-manager
synced 2024-12-27 20:29:47 +01:00
xfconf: support uint (#3946)
This commit is contained in:
parent
f3824311a1
commit
38271ead8e
1 changed files with 26 additions and 2 deletions
|
@ -6,8 +6,31 @@ let
|
|||
|
||||
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:
|
||||
if builtins.isBool v then [
|
||||
if builtins.isAttrs v then [
|
||||
"-t"
|
||||
v.type
|
||||
"-s"
|
||||
(toString v.value)
|
||||
] else if builtins.isBool v then [
|
||||
"-t"
|
||||
"bool"
|
||||
"-s"
|
||||
|
@ -55,9 +78,10 @@ in {
|
|||
attrsOf (attrsOf (oneOf [
|
||||
bool
|
||||
int
|
||||
xfIntVariant
|
||||
float
|
||||
str
|
||||
(listOf (oneOf [ bool int float str ]))
|
||||
(listOf (oneOf [ bool int xfIntVariant float str ]))
|
||||
])) // {
|
||||
description = "xfconf settings";
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue