refactor(nixos): reuse registry uniqueness predicate
This commit is contained in:
@@ -7,10 +7,9 @@
|
||||
}
|
||||
{
|
||||
assertion = entries:
|
||||
let
|
||||
ports = lib.concatMap (entry: entry.value.udp.ports) entries;
|
||||
in
|
||||
builtins.length (lib.unique ports) == builtins.length ports;
|
||||
lib.registry.predicates.uniqueValue (entry: entry.value) (
|
||||
lib.concatMap (entry: map (port: entry // { value = port; }) entry.value.udp.ports) entries
|
||||
);
|
||||
message = "Route UDP ports must be unique.";
|
||||
}
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user