phosh: restrict the scale config value to strictly positive values or null

This commit is contained in:
colin 2022-06-02 01:40:43 -07:00
parent cabf369f83
commit 1d0649f929

View File

@ -78,7 +78,13 @@ let
description = ''
Display scaling factor.
'';
type = types.nullOr (types.either types.ints.unsigned types.float);
type = types.nullOr (
types.addCheck
(types.either types.int types.float)
(x : x > 0)
) // {
description = "null or positive integer or float";
};
default = null;
example = 2;
};