mirror of
https://github.com/ilyakooo0/haskell.nix.git
synced 2024-09-20 11:27:22 +03:00
bd603e0b51
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.
17 lines
449 B
Nix
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;
|
|
})
|