Skip to content

Commit 3906547

Browse files
authored
docs(gotchas): Overriding libssh2 (#411)
1 parent 4b46bc5 commit 3906547

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

doc/gotchas.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Gotchas
2+
3+
{#libssh2}
4+
## Overriding `libssh2` Haskell library
5+
6+
Overriding the package with `packages.libssh2.source = "0.2.0.9"` results in infinite recursion.
7+
8+
Possibly having to do with `cabal2nix` not understanding that [`libssh2` in `pkgconfig-depends` of `libssh2.cabal`](https://github.com/portnov/libssh2-hs/blob/bf7cbe643c7f4fb4fad3963705feb8351471eb01/libssh2/libssh2.cabal#L70)
9+
is not self-referential.
10+
11+
Use the following [[settings]] configuration to override `libssh2`:
12+
13+
```nix
14+
# In `haskellProjects.default`
15+
{
16+
settings = {
17+
libssh2 = {
18+
broken = false;
19+
custom = (p: p.overrideAttrs (oa: rec {
20+
version = "0.2.0.9";
21+
src = pkgs.fetchzip {
22+
url = "mirror://hackage/${oa.pname}-${version}/${oa.pname}-${version}.tar.gz";
23+
sha256 = "sha256-/zzj11iOxkpEsKVwB4+IF8dNZwEuwUlgw+cZYguN8QI=";
24+
};
25+
}));
26+
};
27+
};
28+
}
29+
```
30+

doc/package-set.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,3 +60,8 @@ Finally, you can externalize this `ghc810` package set as either a flake-parts m
6060
## Examples
6161

6262
- https://github.com/nammayatri/common/pull/11/files
63+
64+
## See also
65+
66+
- [[gotchas]]
67+

0 commit comments

Comments
 (0)