feat(nix): port over libs
This commit is contained in:
parent
03bac12a2d
commit
96b5aa3fef
3 changed files with 104 additions and 1 deletions
13
nix/lib/lists.nix
Normal file
13
nix/lib/lists.nix
Normal file
|
@ -0,0 +1,13 @@
|
|||
let
|
||||
inherit (builtins) length tail;
|
||||
in
|
||||
{
|
||||
flake.lib.lists = rec {
|
||||
shortenList =
|
||||
count: list:
|
||||
let
|
||||
len = length list;
|
||||
in
|
||||
if len <= count then list else (shortenList count (tail list));
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue