vars: simplify validationHash type for better error messages

This commit is contained in:
Jörg Thalheim
2024-12-25 15:46:22 +01:00
committed by Mic92
parent a04e251f96
commit 24fea19344

View File

@@ -79,22 +79,27 @@ in
description = '' description = ''
A set of values that invalidate the generated values. A set of values that invalidate the generated values.
If any of these values change, the generated values will be re-generated. If any of these values change, the generated values will be re-generated.
Lists are not allowed as of now due to potential ordering issues
''; '';
default = null; default = null;
type = # This is more restrictive than json without lists, but currently
let # if a value contains a list, we get an infinite recursion which
data = nullOr (oneOf [ # is hard to understand.
type = nullOr (oneOf [
bool
int
str
(attrsOf (oneOf [
bool
int
str
(attrsOf (oneOf [
bool bool
int int
str str
(attrsOf data) ]))
# lists are not allowed as of now due to potential ordering issues ]))
]); ]);
in
data
// {
description = "JSON compatible data structure";
};
}; };
# the validationHash is the validation interface to the outside world # the validationHash is the validation interface to the outside world
validationHash = lib.mkOption { validationHash = lib.mkOption {