Since I needed this myself, here is a gitignore filter that includes the .git directory itself (which is often needed for running git commands):
{ lib, gitignoreFilter }: path:
let
ignoreFilter = gitignoreFilter path;
dotGit = toString path + "/.git";
in lib.cleanSourceWith {
src = path;
filter = path: type: lib.hasPrefix dotGit path || ignoreFilter path type;
}
It might be worth adding a filter with this functionality to this library
Since I needed this myself, here is a gitignore filter that includes the
.gitdirectory itself (which is often needed for runninggitcommands):It might be worth adding a filter with this functionality to this library