Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make it easy to use stacklock2nix to create a new haskell package set #3

Closed
cdepillabout opened this issue Dec 5, 2022 · 0 comments · Fixed by #12
Closed

make it easy to use stacklock2nix to create a new haskell package set #3

cdepillabout opened this issue Dec 5, 2022 · 0 comments · Fixed by #12
Labels
enhancement New feature or request help wanted Extra attention is needed high-priority

Comments

@cdepillabout
Copy link
Owner

cdepillabout commented Dec 5, 2022

Currently, stacklock2nix exposes Nixpkgs-compatible Haskell package set overlays, created from the contents of the stack.yaml and stack.yaml.lock files. Here's an example of explicitly taking these overlays and applying them to an existing package set:

overrides = final.lib.composeManyExtensions [
# Make sure not to lose any old overrides, although in most cases there
# won't be any.
(oldAttrs.overrides or (_: _: {}))
# An overlay with Haskell packages from the Stackage snapshot.
final.my-example-haskell-stacklock.stackYamlResolverOverlay
# An overlay with `extraDeps` from `stack.yaml`.
final.my-example-haskell-stacklock.stackYamlExtraDepsOverlay
# An overlay with your local packages from `stack.yaml`.
final.my-example-haskell-stacklock.stackYamlLocalPkgsOverlay
# Suggested overrides for common problems.
final.my-example-haskell-stacklock.suggestedOverlay

If you take these overlays and apply them to an existing Nixpkgs Haskell package set (as done in the above code), the resulting Haskell package set will obviously contain packages that aren't in your stack.yaml or stack.yaml.lock files.

For example, the cachix package is in the Nixpkgs Haskell package sets, but it is not in Stackage. So if you use stacklock2nix to create overlays from a local stack.yaml and stack.yaml.lock file, and apply those overlays to a normal Nixpkgs Haskell package set, the resulting package set will contain a cachix derivation.

Instead of just exposing overlays, it would be nice if stacklock2nix also made it easy to create a completely new package sets. That way, you can be sure you are only using/building packages defined in your stack.yaml.lock file, and not additional Haskell packages from Nixpkgs.

I'm not sure what sort of API this would look like for stacklock2nix, or what additional attributes it should expose for this functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed high-priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant