cdepillabout / cdepillabout/stacklock2nix

make stacklock2nix figure out the ghc version it needs automatically

Open
#4 3 comments 1 reaction 0 assignees View on GitHub
enhancement good first issue help wanted
Dominant language
Nix
Stars
57
Forks
11
PR merge metrics
No merged PRs in 30d

Description

I think it should be possible to make `stacklock2nix` figure out the ghc version is needs automatically.

Currently, the API of `stacklock2nix` requires you to pass a full package set, like the following (the `baseHaskellPkgSet` attr):

https://github.com/cdepillabout/stacklock2nix/blob/ac3578398a67d74382488974b385981123dd7a87/my-example-haskell-lib-easy/flake.nix#L41-L56

It should be possible for `stacklock2nix` to figure out the GHC version automatically from the stackage package set, and then use that internally. I imagine an API like the following would be possible:

```nix
final.stacklock2nix {
stackYaml = ./stack.yaml;
haskell = final.haskell;
}
```

`stacklock2nix` would internally look in the resolver in `stack.yaml.lock`, figure out it uses GHC-9.2.4, translate that to `haskell.packages.ghc924`, and then just use that.

If a user wanted to use a different package set (like `haskell.packages.native-bignum.ghc924`), then they could just fall-back to using the `baseHaskellPkgSet` argument.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.