summaryrefslogtreecommitdiff
path: root/lib/default.nix
blob: 26557ede380829f7dcb399f95722e3868c067791 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ pkgs }:
with pkgs;
rec {
  nodeEnv = import ./node-env.nix;

  fetchedGithub = path:
    let
      json = lib.importJSON path;
    in rec {
      version = json.tag;
      pname = json.meta.name;
      name = "${pname}-${version}";
      src = fetchFromGitHub json.github;
    };

  fetchedGit = path:
    let
      json = lib.importJSON path;
    in rec {
      version = json.tag;
      pname = json.meta.name;
      name = "${pname}-${version}";
      src = fetchgit json.git;
    };

  fetchedGitPrivate = path:
    let
      json = lib.importJSON path;
    in rec {
      version = json.tag;
      pname = json.meta.name;
      name = "${pname}-${version}";
      src = builtins.fetchGit {
        url = json.git.url;
        ref = "master";
        rev = json.git.rev;
      };
    };
} // (if builtins.pathExists ./private then callPackage ./private {} else {})