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:
parent
15d2e0e63b
commit
b48e64162a
6 changed files with 263 additions and 21 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue