mirror of
https://github.com/ilyakooo0/haskell.nix.git
synced 2024-11-10 15:19:01 +03:00
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;
|
||
|
})
|