_experimental-update-script-combinators.sequence: Loosen attrPath constraint

We only allow a single value for `attrPath` across all sequenced update scripts.
But previously `null` (representing `passthru.updateScript.attrPath` not being defined) was counted as one value.
This would prevent us from explicitly specifying `attrPath` in `gnome.updateScript` in the next commit.

Let’s ignore update scripts without specified `attrPath` attribute for the purpose of this check.
This commit is contained in:
Jan Tojnar 2025-03-03 00:03:21 +01:00
parent f54d20c3a1
commit 6403eb8f4b

View File

@ -169,9 +169,11 @@ rec {
assert lib.assertMsg (lib.all validateFeatures scripts)
"Combining update scripts with features enabled (other than silent scripts and an optional single script with commit) is currently unsupported.";
assert lib.assertMsg (
builtins.length (
lib.unique (
builtins.filter (attrPath: attrPath != null) (
builtins.map (
{
attrPath ? null,
@ -180,7 +182,8 @@ rec {
attrPath
) scripts
)
) == 1
)
) <= 1
) "Combining update scripts with different attr paths is currently unsupported.";
{