haskell.nix/lib/fetch-external.nix
Rodney Lorrimar bd603e0b51
Provide hackage and stackage from haskell.nix
Providing hackage and stackage here simplifies usage of the new
Haskell Infrastructure.

With this change, the user doesn't need to specify revisions of the
external repos, or update them.

Basically, with hackage.nix and stackage.nix, the latest version is
always best, because snapshots and package versions are added on
top. So there is no need for users to choose a revision.

Also add mkStackPkgSet which is a shortcut for building stack
projects.
2019-02-13 14:51:10 +10:00

17 lines
449 B
Nix

# Provides a function for fetching a GitHub repo from a JSON spec,
# overridable with the given entry on the NIX_PATH.
let
overrideWith = import ./override-with.nix;
in
{ name, specJSON, override }:
let
spec = builtins.fromJSON (builtins.readFile specJSON);
in
overrideWith override
(builtins.fetchTarball {
inherit name;
url = "${spec.url}/archive/${spec.rev}.tar.gz";
inherit (spec) sha256;
})