Skip to content

Commit b6508f8

Browse files
shivaraj-bhsrid
andauthored
docs(dependency): Overriding source of a multi-package Haskell repo (#404)
* docs(dependency): Overriding source of a multi-package Haskell repo * Update dependency.md --------- Co-authored-by: Sridhar Ratnakumar <[email protected]>
1 parent b9502c2 commit b6508f8

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

doc/dependency.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,33 @@ If you want to use the `master` branch of the [ema](https://hackage.haskell.org/
4343
```
4444
1. Re-run the nix shell (`nix develop`).
4545
46+
### Using a multi-package Haskell Git repo {#multi-path}
47+
48+
If you want to override multiple dependencies whose source exist in the same mono repo (for e.g., `foo` and `bar` in [haskell-multi-nix](https://github.com/srid/haskell-multi-nix), you can do so as follows:
49+
50+
1. Add a flake input pointing to the monorepo (eg., `haskell-multi-nix` Git repo) in `flake.nix`:
51+
```nix
52+
{
53+
inputs = {
54+
haskell-multi-nix.url = "github:srid/haskell-multi-nix";
55+
haskell-multi-nix.flake = false;
56+
};
57+
}
58+
```
59+
1. Add a separate entry in `haskellProjects.<name>.packages` for each of the package in the subdirectories:
60+
```nix
61+
{
62+
perSystem = { self', config, pkgs, ... }: {
63+
haskellProjects.default = {
64+
packages = {
65+
foo.source = inputs.haskell-multi-nix + /foo;
66+
bar.source = inputs.haskell-multi-nix + /bar;
67+
};
68+
};
69+
};
70+
}
71+
```
72+
4673
### Using a Hackage version {#hackage}
4774
4875
`packages.<name>.source` also supports Hackage versions. So the following works to pull [ema 0.8.2.0](https://hackage.haskell.org/package/ema-0.8.2.0):

0 commit comments

Comments
 (0)