on e94de40 help sign in
haskell.nix/lib/fetch-external.nix
16 lines 449 B history raw
1# Provides a function for fetching a GitHub repo from a JSON spec,
2# overridable with the given entry on the NIX_PATH.
4let
5 overrideWith = import ./override-with.nix;
6in
7 { name, specJSON, override }:
8 let
9 spec = builtins.fromJSON (builtins.readFile specJSON);
10 in
11 overrideWith override
12 (builtins.fetchTarball {
13 inherit name;
14 url = "${spec.url}/archive/${spec.rev}.tar.gz";
15 inherit (spec) sha256;
16 })