lib.fileset
needs something like lib.cleanSource
#269517
Labels
5. scope: tracked
Issue (or PR) is linked back to a `5. scope: tracking` issue
Issue description
lib.cleanSource
filters out some of the most commonly unneeded files for you by default:.git
directory/file, but also other version control systems like.svn
or.hg
default.nix~
.o
and.so
(this one seems a bit weird to me)result
symlinksWhile it's possible to use
this is clunky and makes the fileset library reliant on
lib.sources
. We should eventually be able to deprecatelib.sources
at some point, but then we need a replacement.One can also set up manual filters, but it's not pretty:
Ideas
lib.fileset.clean
One simple idea is to have a
lib.fileset.clean ./.
that does kind of the same.I don't like how the filtered out files are fairly arbitrary though. What if another editor comes along and uses the
.blorp
file extension to store its swap files, would we add it to this function and risk breaking users? The file set library should stay backwards compatible.Filter library
So another idea would be to allow creating a sort of library of filters, something like
Then these could be combined in a
fileFilter
as necessary. Maybe a bit too manual though.Versioned
lib.fileset.clean
Another idea (which could also use the above) would be to create a versioned
clean
function likeWhere each single version stays backwards compatible, but new ones can always be introduced as necessary.
This issue is sponsored by Antithesis ✨
The text was updated successfully, but these errors were encountered: