Skip to content

wip: Add callCabalToNix #59

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

Closed
wants to merge 1 commit into from
Closed

wip: Add callCabalToNix #59

wants to merge 1 commit into from

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Feb 13, 2019

It's a bit of a pain to run cabal new-configure ; plan-to-nix ; cabal-to-nix. This should be automated. One way to do this is with IFD.

As currently implemented, this needs the Nix sandbox disabled to work, because it needs to run cabal update. I'm not yet sure how to get a fixed-output derivation for 01-index.tar.gz. This file is always being appended to.

It seems to work when building with option build-use-sandbox = false.
@rvl rvl added enhancement New feature or request wip Work In Progress labels Feb 13, 2019
@rvl rvl mentioned this pull request Feb 14, 2019
@angerman
Copy link
Collaborator

This suffers essentially from the same issues that #120 (cabalPlanToNix) suffers from. We need some form to inject the index-state that is reproducable. And have cabal accept that.

I wonder if we could do the following:

  • download the most recent index state from hackage, this will be impure :-/ filter it to the correct timestamp, and
  • provide a --file option to new-update that takes the file instead of trying to fetch it from hackage.

@angerman
Copy link
Collaborator

Since input-output-hk/nix-tools#52 we have truncate-index which can produce deterministic hackage indices given an index-state time stamp.

In http://chriswarbo.net/projects/nixos/useful_hacks.html, chris lined out how to pre-populate a hackage index directly into ~/.cabal.

The idea now is that we add a lookup of indexState -> hash with day granularity (YYYY-MM-DDT00:00:00Z) from April 1st 2019 to input-output-hk/hackage.nix and update that on a daily basis as we do with the hackage expressions already. This would then allow to pluck a given hackage-index (at day granularity -- or you will have to provide the hash yourself), and compute dependencies from there. This could provide the basis for cabalToNix and projectToNix. We notably have the same similar information with input-output-hk/stackage.nix as well, just with a fixed resolution instead of the option to solve from a larger package universe.

@rvl
Copy link
Contributor Author

rvl commented Jun 15, 2019

Closed in favour of #122 and #146.

@rvl rvl closed this Jun 15, 2019
andreabedini pushed a commit to andreabedini/haskell.nix that referenced this pull request Sep 14, 2022
andreabedini pushed a commit to andreabedini/haskell.nix that referenced this pull request Sep 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wip Work In Progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants