diff --git a/lib/lists.nix b/lib/lists.nix index 4b5f04a67585..af70faacbcd7 100644 --- a/lib/lists.nix +++ b/lib/lists.nix @@ -209,6 +209,10 @@ in rec { assert list != []; elemAt list (dec (length list)); + # Return all elements but the last + init = list: assert list != []; take (length list - 1) list; + + # Zip two lists together. zipTwoLists = xs: ys: let