dapphub / dapptools

Dapp, Seth, Hevm, and more
https://dapp.tools
2.1k stars 325 forks source link

Make default.nix an overlay #317

Open asymmetric opened 4 years ago

asymmetric commented 4 years ago

Similar to mozilla-nixpkgs.

Benefits:

Cons:

I think for this to actually work well, we'd have to stop exporting this, otherwise we're actually going to interfere with haskell dependencies from nixpkgs, which can cause lots of downstream rebuilds.

MrChico commented 4 years ago

Wrt the haskell stuff I think we need to update to latest ghc, which shouldnt be too hard

livnev commented 4 years ago

@asymmetric Won't something like this work already?

  overlays = [ (import (builtins.fetchGit {
    url = "git@github.com:dapphub/dapptools.git";
    rev = "4b45ad07bafd6917f4bf5ba518d53f0ad1f82de3";
    } + /overlay.nix)
  ];
asymmetric commented 4 years ago

@livnev yeah absolutely, but it’s one more thing we have to explain people how to do (or they have to figure out themselves).

The main benefit would be standardization.

livnev commented 4 years ago

@asymmetric Agreed. 👍

While we are on the subject, what is the advantage of the overlay approach versus doing something like

dapptools = import (builtins.fetchGit {
    url = "git@github.com:dapphub/dapptools.git";
    rev = "4b45ad07bafd6917f4bf5ba518d53f0ad1f82de3";
    }) {};

and then using dapptools.seth etc.? That way we know we won't mess up people's haskell package set etc.

asymmetric commented 4 years ago

Now that I think of it, we would actually lose the binary cache, since everyone would be layering the overlay on top of a different version of nixpkgs. I think that's why we do it the current way in the first place.

The mozilla-nixpkgs overlay downloads (I guess statically linked?) pre-compiled binaries from mozilla's cache, so they don't have this problem.

:thinking: