_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.

Changed files
+11 -8
pkgs
common-updater
+11 -8
pkgs/common-updater/combinators.nix
···
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.map (
-
{
-
attrPath ? null,
-
...
-
}:
-
attrPath
-
) scripts
+
builtins.filter (attrPath: attrPath != null) (
+
builtins.map (
+
{
+
attrPath ? null,
+
...
+
}:
+
attrPath
+
) scripts
+
)
)
-
) == 1
+
) <= 1
) "Combining update scripts with different attr paths is currently unsupported.";
{