@@ -108,7 +108,16 @@ If your project has a `cabal.project` you can add a `default.nix` like this:
108Note: The `cleanGit` call will exclude any files not in the index file
108Note: The `cleanGit` call will exclude any files not in the index file
109in the local `.git` directory. This is extremely useful as it avoids
109in the local `.git` directory. This is extremely useful as it avoids
110unwanted builds (for instance when the contents of `dist-newstyle` are
110unwanted 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:
117+ src = pkgs.haskell-nix.haskellLib.cleanGit
118+ { src = ./.; subDir = "subdir/another-subdir"; };
113You can build a component from your project with `nix-build` (in this
122You can build a component from your project with `nix-build` (in this
114case the `hello` executable in a `helloworld` package):
123case the `hello` executable in a `helloworld` package):