forked from obsidiansystems/hydra-pay
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
82 lines (75 loc) · 2.89 KB
/
default.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
73
74
75
76
77
78
79
80
81
82
{ system ? builtins.currentSystem
, android-build ? false
, cardanoProject ? import ./dep/cardano-project {
inherit android-build system;
}
}:
with cardanoProject;
with obelisk;
let
foldExtensions = lib.foldr lib.composeExtensions (_: _: {});
deps = nixpkgs.thunkSet ./dep;
flake-compat = import deps.flake-compat;
hydra = (flake-compat {
inherit system;
src = deps.hydra;
}).defaultNix.packages.${system};
cardano-node = import deps.cardano-node {};
pkgs = nixpkgs;
livedoc-devnet-script = pkgs.runCommand "livedoc-devnet-script" { } ''
cp -r ${./livedoc-devnet} $out
'';
p = project ./. ({ pkgs, ... }@args:
let
pd = cardanoProjectDef args;
haskellLib = pkgs.haskell.lib;
in
pkgs.lib.recursiveUpdate pd {
android.applicationId = "systems.obsidian.obelisk.examples.minimal";
android.displayName = "Obelisk Minimal Example";
ios.bundleIdentifier = "systems.obsidian.obelisk.examples.minimal";
ios.bundleName = "Obelisk Minimal Example";
packages =
{
hydra-pay = ./hydra-pay;
hydra-pay-core = ./hydra-pay-core;
cardano-transaction = pkgs.hackGet ./dep/cardano-transaction-builder;
bytestring-aeson-orphans = pkgs.hackGet ./dep/bytestring-aeson-orphans;
};
overrides = self: super: pd.overrides self super // {
bytestring-aeson-orphans = haskellLib.doJailbreak super.bytestring-aeson-orphans;
aeson-gadt-th = haskellLib.doJailbreak (haskellLib.disableCabalFlag (self.callCabal2nix "aeson-gadt-th" deps.aeson-gadt-th {}) "build-readme");
string-interpolate = haskellLib.doJailbreak (haskellLib.dontCheck super.string-interpolate);
cardano-transaction = haskellLib.overrideCabal super.cardano-transaction (drv: {
librarySystemDepends = (drv.librarySystemDepends or []) ++ [
cardano-node.cardano-cli
];
});
hydra-pay = haskellLib.overrideCabal super.hydra-pay (drv: {
librarySystemDepends = (drv.librarySystemDepends or []) ++ [
cardano-node.cardano-node
cardano-node.cardano-cli
hydra.hydra-node.package.components.exes.hydra-node
hydra.hydra-node.package.components.exes.hydra-tools
];
});
backend = haskellLib.overrideCabal super.backend (drv: {
librarySystemDepends = (drv.librarySystemDepends or []) ++ [
cardano-node.cardano-node
cardano-node.cardano-cli
hydra.hydra-node.package.components.exes.hydra-node
hydra.hydra-node.package.components.exes.hydra-tools
pkgs.jq
pkgs.coreutils
livedoc-devnet-script
];
});
};
});
hydra-pay-exe = pkgs.runCommandNoCC "hydra-pay" {} ''
mkdir -p $out
cp -r ${p.exe}/* $out/
mv $out/backend $out/hydra-pay
'';
in
p // { exe = hydra-pay-exe; inherit cardano-node hydra deps;}