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 = ''
A set of values that invalidate the generated values.
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;
type =
let
data = nullOr (oneOf [
# This is more restrictive than json without lists, but currently
# if a value contains a list, we get an infinite recursion which
# is hard to understand.
type = nullOr (oneOf [
bool
int
str
(attrsOf data)
# lists are not allowed as of now due to potential ordering issues
(attrsOf (oneOf [
bool
int
str
(attrsOf (oneOf [
bool
int
str
]))
]))
]);
in
data
// {
description = "JSON compatible data structure";
};
};
# the validationHash is the validation interface to the outside world
validationHash = lib.mkOption {