@@ -1,7 +1,16 @@
11# DO NOT HAND-EDIT THIS FILE
2−import ((import <nixpkgs> {}).fetchFromGitHub (
3− let json = builtins.fromJSON (builtins.readFile ./github.json);
4− in { inherit (json) owner repo rev sha256;
5− private = json.private or false;
6− }
7−))
2+let
3+ fetch = { private ? false, ... }@args: if private && builtins.hasAttr "fetchGit" builtins
4+ then fetchFromGitHubPrivate args
5+ else (import <nixpkgs> {}).fetchFromGitHub (builtins.removeAttrs args ["branch"]);
6+ fetchFromGitHubPrivate =
7+ { owner, repo, rev, branch ? null, name ? null, sha256 ? null, private ? false
8+ , fetchSubmodules ? false, githubBase ? "github.com", ...
9+ }: assert !fetchSubmodules;
10+ builtins.fetchGit ({
11+ url = "ssh://git@${githubBase}/${owner}/${repo}.git";
12+ inherit rev;
13+ }
14+ // (if branch == null then {} else { ref = branch; })
15+ // (if name == null then {} else { inherit name; }));
16+in import (fetch (builtins.fromJSON (builtins.readFile ./github.json)))