lib/util: add groupListBySize

Splits up a list into many sub-lists based on the given max-size.

e.g.
```nix
groupListBySize 2 [ 1 2 3 4 5 ]
=> [ [ 1 2 ] [ 3 4 ] [ 5 ] ]
```
This commit is contained in:
Matt Sturgeon 2024-08-19 00:45:47 +01:00
parent 693e749edb
commit 8f99c3953c
No known key found for this signature in database
GPG key ID: 4F91844CED1A8299
3 changed files with 61 additions and 0 deletions

View file

@ -71,6 +71,7 @@ let
concatNonEmptyLines
emptyTable
enableExceptInTests
groupListBySize
hasContent
ifNonNull'
listToUnkeyedAttrs