on master help sign in
Merge pull request #97 from obsidiansystems/eac-fix-https-loader

Fix https/default.nix loader

commit88010ab6ae01b78f2df3c2aa26aaa579720030c5 authorLuigy Leon <luichi.19@gmail.com> dateThu 17 May 2018, 15:29 (8 years ago) parent47419edea3f901
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)))