diff --git a/utils.nix b/utils.nix index bcc7e79..0f78c1a 100644 --- a/utils.nix +++ b/utils.nix @@ -1,7 +1,7 @@ { lib, ... }: with lib; with builtins; rec { - readLines = f: filter (s: (isString s) && s != "") (split "\n" (readFile f)); + readLines = f: let lines = filter isString (split "\n" (readFile f)); in take ((length lines) - 1) lines; splitWhitespace = s: filter isString (builtins.split "[[:space:]]+" s); abs = i: if i >= 0 then i else i * -1; delta = x: y: abs (x - y);