mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
parent
6dc8a43f39
commit
28334988db
1 changed files with 5 additions and 15 deletions
|
@ -16,16 +16,6 @@ let
|
|||
description = "pair of ${x.description}";
|
||||
};
|
||||
|
||||
floatBetween = a: b:
|
||||
with types;
|
||||
let
|
||||
# toString prints floats with hardcoded high precision
|
||||
floatToString = f: toJSON f;
|
||||
in addCheck float (x: x <= b && x >= a) // {
|
||||
description = "a floating point number in "
|
||||
+ "range [${floatToString a}, ${floatToString b}]";
|
||||
};
|
||||
|
||||
mkDefaultAttrs = mapAttrs (n: v: mkDefault v);
|
||||
|
||||
# Basically a tinkered lib.generators.mkKeyValueDefault
|
||||
|
@ -96,7 +86,7 @@ in {
|
|||
};
|
||||
|
||||
fadeSteps = mkOption {
|
||||
type = pairOf (floatBetween 1.0e-2 1);
|
||||
type = pairOf (types.numbers.between 1.0e-2 1);
|
||||
default = [ 2.8e-2 3.0e-2 ];
|
||||
example = [ 4.0e-2 4.0e-2 ];
|
||||
description = ''
|
||||
|
@ -132,7 +122,7 @@ in {
|
|||
};
|
||||
|
||||
shadowOpacity = mkOption {
|
||||
type = floatBetween 0 1;
|
||||
type = types.numbers.between 0 1;
|
||||
default = 0.75;
|
||||
example = 0.8;
|
||||
description = ''
|
||||
|
@ -151,7 +141,7 @@ in {
|
|||
};
|
||||
|
||||
activeOpacity = mkOption {
|
||||
type = floatBetween 0 1;
|
||||
type = types.numbers.between 0 1;
|
||||
default = 1.0;
|
||||
example = 0.8;
|
||||
description = ''
|
||||
|
@ -160,7 +150,7 @@ in {
|
|||
};
|
||||
|
||||
inactiveOpacity = mkOption {
|
||||
type = floatBetween 0.1 1;
|
||||
type = types.numbers.between 0.1 1;
|
||||
default = 1.0;
|
||||
example = 0.8;
|
||||
description = ''
|
||||
|
@ -169,7 +159,7 @@ in {
|
|||
};
|
||||
|
||||
menuOpacity = mkOption {
|
||||
type = floatBetween 0 1;
|
||||
type = types.numbers.between 0 1;
|
||||
default = 1.0;
|
||||
example = 0.8;
|
||||
description = ''
|
||||
|
|
Loading…
Reference in a new issue