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:
parent
f3824311a1
commit
38271ead8e
1 changed files with 26 additions and 2 deletions
|
@ -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";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue