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

genericCallCabal2nix: init #54970



Copy link

ElvishJerricco commented Jan 31, 2019

Unify all the various haskellSrc2nix calls into a generic API that's
more convenient than packageSourceOverrides.

Note: I am skeptical of this change. It does include a couple of rather complex functions, which could be too much. But after #52848, I started to feel like the variants were getting a little out of hand and needed unifying. In particular, this also adds fairly generic support for revisions.

/cc @shlevy @mightybyte @Infinisil

Motivation for this change

This enables a pretty convenient alternative to packageSourceOverrides with a lot more power.

haskellPackages.extend(genericSourceOverrides {
  # Gets foo from Hackage, using your sha256 for the tarball.
  foo.version = "";
  foo.sha256 = "...";

  # Gets bar from Hackage, using all-cabal-hashes for sha256 and the cabal file.
  bar.version = "";

  # Gets foobar from Hackage, using all-cabal-hashes for the
  # sha256, but the specified revision for the cabal file.
  foobar.version = "";
  foobar.revision = "2";
  foobar.revisionSha256 = "...";

  # Builds baz from a custom source.
  baz.src = fetchFromGitHub { ... };

I am open to better names. Not sure generic* really captures the purpose quite right.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Assured whether relevant documentation is up to date
  • Fits

Unify all the various `haskellSrc2nix` calls into a generic API that's
more convenient than `packageSourceOverrides`.
Copy link

mmahut commented Aug 18, 2019

Are there any updates on this pull request, please?

Copy link

bennofs commented Jan 24, 2020

@peti do you know if this is still relevant?

Copy link

cdepillabout commented May 5, 2020

This is a really interesting PR, but unfortunately it looks like there hasn't been any work on it for a year or so.

@ElvishJerricco please feel free to re-open or send a new PR if you'd like to pursue this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

5 participants
You can’t perform that action at this time.