forked from IntersectMBO/plutus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lib.nix
52 lines (46 loc) · 1.6 KB
/
lib.nix
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
49
50
51
52
{ system ? builtins.currentSystem, config ? {} }:
let
# iohk-nix can be overridden for debugging purposes by setting
# NIX_PATH=iohk_nix=/path/to/iohk-nix
iohkNix = import (
let try = builtins.tryEval <iohk_nix>;
in if try.success
then builtins.trace "using host <iohk_nix>" try.value
else
let
spec = builtins.fromJSON (builtins.readFile ./iohk-nix.json);
in builtins.fetchTarball {
url = "${spec.url}/archive/${spec.rev}.tar.gz";
inherit (spec) sha256;
}) { inherit config system; };
# nixpkgs can be overridden for debugging purposes by setting
# NIX_PATH=custom_nixpkgs=/path/to/nixpkgs
pkgs = iohkNix.pkgs;
nixpkgs = iohkNix.nixpkgs;
lib = pkgs.lib;
getPackages = iohkNix.getPackages;
# List of all plutus pkgs. This is used for `isPlutus` filter and `mapTestOn`
plutusPkgList = [
"language-plutus-core"
"plutus-core-interpreter"
"plutus-playground-server"
"plutus-playground-lib"
"plutus-playground-client"
"plutus-server-invoker"
"plutus-exe"
"plutus-ir"
"plutus-tx"
"plutus-tutorial"
"plutus-use-cases"
"interpreter"
"marlowe"
"meadow"
"wallet-api"
];
plutusHaskellPkgList = lib.filter (v: v != "plutus-playground-client" && v != "plutus-server-invoker") plutusPkgList;
isPlutus = name: builtins.elem name plutusPkgList;
regeneratePackages = iohkNix.stack2nix.regeneratePackages { hackageSnapshot = "2019-02-28T09:58:14Z"; };
comp = f: g: (v: f(g v));
in lib // {
inherit getPackages iohkNix isPlutus plutusHaskellPkgList plutusPkgList regeneratePackages pkgs nixpkgs comp;
}