on master help sign in
Fix https/default.nix loader
commitea3f901cd2e05953bc5f16e93d98564f5684b06f author3noch <eacameron@gmail.com> dateThu 17 May 2018, 15:29 (8 years ago) parent47419ed
1 file changed+15−6
lib/https/default.nix+15−6
lib/https/default.nix+15−6
@@ -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)))