1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-07 10:11:47 +02:00

Add builtins.filterPath

This is like builtins.{filterSource,path}, but returns a virtual path
that applies the filter lazily, rather than copying the result to the
Nix store. Thus filterPath can be composed.
This commit is contained in:
Eelco Dolstra 2022-12-19 13:45:06 +01:00
parent 15d2e0e63b
commit b48e64162a
6 changed files with 263 additions and 21 deletions

View file

@ -19,6 +19,8 @@ rec {
sum = foldl' (x: y: add x y) 0;
hasPrefix = pref: str: substring 0 (stringLength pref) str == pref;
hasSuffix = ext: fileName:
let lenFileName = stringLength fileName;
lenExt = stringLength ext;