…or is there some more idiomatic way to do this?
I’ve tried pkgs.lib.sourceByRegex /path [ "^.*\.md$" ]
, but it only seems to copy the top-level Markdown files in path
to the /nix/store
instead of all Markdown files in subdirectories.
Is this something I’ll have to write from scratch using readDir
and company?
You might want to have a look at GitHub - numtide/nix-filter: a small self-container source filtering lib.
You might want to have a look at GitHub - numtide/nix-filter: a small self-contained source filtering lib
Thanks for the recommendation. AFAICT it looks like this behaves similarly to lib.sourceByRegex
where it only includes the top-level Markdown files.
I left a comment on an open issue with nix-filter
. Let’s see how that pans-out: Improve ergonomics for glob matching · Issue #9 · numtide/nix-filter · GitHub
Are you looking for lib.sourceFilesBySuffices
?
Are you looking for
lib.sourceFilesBySuffices
?
That’s recursive, but it includes a bunch of garbage empty directories in the output too.