on stack-cache-native help sign in
haskell.nix/docs/dev/pkg-map.md
41 lines 1.8 kB history raw
1# Mapping non-Haskell dependencies to Nixpkgs
3Cabal files may contain dependencies to external non-Haskell
4dependencies via:
5* [`build-tool-depends`](https://cabal.readthedocs.io/en/latest/developing-packages.html#pkg-field-build-tool-depends)
6* [`pkgconfig-depends`](https://cabal.readthedocs.io/en/latest/developing-packages.html#pkg-field-pkgconfig-depends).
7* [`frameworks`](https://cabal.readthedocs.io/en/latest/developing-packages.html#pkg-field-frameworks)
8* [`extra-libraries`](https://cabal.readthedocs.io/en/latest/developing-packages.html#pkg-field-extra-libraries)
10If there is a `pkgs` attribute in Nixpkgs that matches the name given
11in the Cabal file, then it will be added as a dependency (see the
12output of `cabal-to-nix`). Otherwise, there needs to be a mapping from
13Cabal file names (decided by the package author) to Nix package
14identifiers.
16### Nixpkgs overlay
18The user may solve it by themself by overriding Nixpkgs and adding a
19package alias. For example:
21```nix
22nixpkgs.overlays = [
23 (self: super: {
24 icuuc = self.icu;
25 icui18n = self.icu;
26 icudata = self.icu;
27 })
28];
29```
31### Mapping in Haskell.nix
33Alternatively, if the name is commonly used, an alias can be added to
34the Haskell.nix sources, so that it's solved for all users.
36* [`lib/pkgconf-nixpkgs-map.nix`](https://github.com/input-output-hk/haskell.nix/blob/master/lib/pkgconf-nixpkgs-map.nix) - for `pkgconfig-depends`
37* [`lib/system-nixpkgs-map.nix`](https://github.com/input-output-hk/haskell.nix/blob/master/lib/system-nixpkgs-map.nix) - for `build-tool-depends`, `frameworks`, `extra-libraries`, etc.
39!!! tip "Open a PR"
40 Please go ahead and open a [pull request](https://github.com/input-output-hk/haskell.nix/pulls)
41 to improve the package mappings.