kepler
kepler copied to clipboard
Make a Nix derivation for hs-abci
We want to make a Nix derivation for hs-abci since it's the goal to have everything in this project built on Nix. We still want to make use of stack / cabal for incremental builds during development though.
There might be some research here since everyone is kind of new to Nix. Everything I know about it I'm learning from this example.
Please comment here on the strategy.
https://github.com/Gabriel439/haskell-nix
https://stackoverflow.com/questions/43443961/build-simple-haskell-library-using-nix
I have a little bit of experience with nix, but not a lot. I think a good solution would be this stack:
-
hpack to go from
package.yaml
->.cabal
file - Cabal2Nix to generate a default.nix file for each package That would allow the entire project to be "built on Nix"
To generate a derivation it might be useful to follow this skeleton/tutorial for a nix based monorepo. The crux of the monorepo approach is this nix function that traverse directories and picks up .cabal
files, then adds those dependencies to the haskell packages in release.nix so that the packages can depend on each other. Then it generates a derivation.
Alternatively, you could just have a release.nix
per package, but that might be kind of cumbersome.
@JonathanLorimer There's #53 which I've been using downstream for a while. I have some WIP commits locally bumping it to keep up with latest stack bump in master but it still needs some cleanup and getting the example apps to build again.
@alexfmpe oh nice, that looks great.