summaryrefslogtreecommitdiff
path: root/lib/default.nix
blob: 86832d47fa868749d28b4076cf591e42b533bb12 (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
40
41
42
43
44
45
46
47
48
{ pkgs }:
with pkgs;
rec {
  yarn2nixPackage = let
    src = builtins.fetchGit {
      url = "git://github.com/moretea/yarn2nix.git";
      ref = "master";
      rev = "780e33a07fd821e09ab5b05223ddb4ca15ac663f";
    };
  in
    (callPackage src {}) // { inherit src; };

  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 {})