1 let nixpkgs_unstable = import (builtins.fetchTarball {
2 # FIXME: upgrade to nixpkgs 19 when stable and stick to stable
4 name = "nixos-unstable-2018-12-08";
5 url = https://github.com/nixos/nixpkgs/archive/61c3169a0e17d789c566d5b241bfe309ce4a6275.tar.gz;
6 sha256 = "0qbycg7wkb71v20rchlkafrjfpbk2fnlvvbh3ai9pyfisci5wxvq";
11 inherit nixpkgs_unstable;
14 json = lib.importJSON path;
17 name = "${json.meta.name}-${version}";
18 src = fetchFromGitHub json.github;
23 json = lib.importJSON path;
26 name = "${json.meta.name}-${version}";
27 src = fetchgit json.git;
30 fetchedGitPrivate = path:
32 json = lib.importJSON path;
35 name = "${json.meta.name}-${version}";
36 src = fetchgitPrivate json.git;
39 checkEnv = var: builtins.stringLength (builtins.getEnv var) > 0;
41 wrap = { paths ? [], vars ? {}, file ? null, script ? null, name ? "wrap" }:
42 assert file != null || script != null ||
43 abort "wrap needs 'file' or 'script' argument";
45 set = n: v: "--set ${pkgs.lib.escapeShellArg n} " +
46 "${pkgs.lib.escapeShellArg v}";
47 args = (map (p: "--prefix PATH : ${p}/bin") paths) ++
48 (builtins.attrValues (pkgs.lib.mapAttrs set vars));
52 f = if file == null then writeScript name script else file;
53 buildInputs = [ makeWrapper ];
56 makeWrapper "$f" "$out" ${toString args}