@@ -108,7 +108,16 @@ If your project has a `cabal.project` you can add a `default.nix` like this:
108108Note: The `cleanGit` call will exclude any files not in the index file
109109in the local `.git` directory. This is extremely useful as it avoids
110110unwanted builds (for instance when the contents of `dist-newstyle` are
111−modified by cabal).
111+modified by cabal). It is important that `src` is the root directory
112+of the repo (so `cleanGit` can find the `.git` directory). If the project
113+is not at the root of the repo, then also pass `subDir` to `cleanGit` with the
114+location of the project relative to `src` as a string. For example:
115+
116+```
117+ src = pkgs.haskell-nix.haskellLib.cleanGit
118+ { src = ./.; subDir = "subdir/another-subdir"; };
119+```
120+
112121
113122You can build a component from your project with `nix-build` (in this
114123case the `hello` executable in a `helloworld` package):