https://github.com/brainrake/extra-sources-test
https://github.com/brainrake/extra-sources-test
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/brainrake/extra-sources-test
- Owner: brainrake
- Created: 2022-03-31T14:35:26.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-31T15:24:12.000Z (about 4 years ago)
- Last Synced: 2025-04-02T18:51:49.416Z (about 1 year ago)
- Language: Nix
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Test repository for adding extra dependencies programatically via haskell.nix.
### Goal
Take a flake input and a list of subdirectories. Add the cabal packages defined there as dependencies to the main package (`mypackage`).
### Approach
Generate package definitions for each dependency package with `cabal-to-nix`, add them to the package's `pkg-def-extras`.
Result:
````nix develop````
```
...
[__1] unknown package: mydep (dependency of mypackage)
...
```
Cabal can't find the package.
This is because `cabalProject` first calls `callCabalProjectToNix` which doesn't use `pkg-def-extras`.
### What now?
`callCabalProjectToNix` has two ways to include extra packages:
- via `cabalProjectLocal` and friends
- via `configureArgs` `--package-db`
Let's try to generate a package db with haskell.nix and use `--package-db`.