@@ -127,6 +127,16 @@ on using cleanGit](clean-git.md)). For example:
127127 { src = ./.; subDir = "subdir/another-subdir"; };
128128```
129129
130+If you want to use a custom filtering function, don't use the built-in nix `filterSource` function.
131+Due to some technicalities about how filtering and the nix store work, it will cause all components in
132+your project to be rebuilt any time any part of the project source changes. Use `cleanSourceWith` instead:
133+
134+```
135+ src = pkgs.haskell-nix.haskellLib.cleanSourceWith
136+ { src = ./.; filter = myFilterFunction; };
137+```
138+
139+Note that `cleanSourceWith` will also take the `subDir` argument.
130140
131141You can build a component from your project with `nix-build` (in this
132142case the `hello` executable in a `helloworld` package):