forked from IntersectMBO/plutus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lib.nix
72 lines (64 loc) · 1.86 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{ 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 public (i.e. published Haddock, will go on Hackage) Plutus pkgs
plutusPublicPkgList = [
"language-plutus-core"
"plutus-contract"
"plutus-core-interpreter"
"plutus-playground-lib"
"plutus-exe"
"plutus-ir"
"plutus-tx"
"plutus-wallet-api"
"plutus-emulator"
"iots-export"
];
isPublicPlutus = name: builtins.elem name plutusPublicPkgList;
# List of all Plutus packges in this repository.
plutusPkgList = plutusPublicPkgList ++ [
"plutus-playground-server"
"plutus-tutorial"
"plutus-book"
"plutus-use-cases"
"playground-common"
"marlowe"
"marlowe-playground-server"
"deployment-server"
];
isPlutus = name: builtins.elem name plutusPkgList;
regeneratePackages = iohkNix.stack2nix.regeneratePackages { hackageSnapshot = "2019-05-28T09:58:14Z"; };
unfreePredicate = pkg: (builtins.parseDrvName pkg.name).name == "kindlegen";
comp = f: g: (v: f(g v));
in lib // {
inherit
getPackages
iohkNix
isPlutus
isPublicPlutus
plutusPublicPkgList
plutusPkgList
regeneratePackages
unfreePredicate
nixpkgs
pkgs
comp;
}