forked from mlabs-haskell/ogmios-nixos
-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
113 lines (91 loc) · 2.99 KB
/
flake.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
{
description = "ogmios";
inputs = {
ogmios-src = {
url = "git+https://github.com/CardanoSolutions/ogmios?tag=v6.9.0&submodules=1";
flake = false;
};
haskell-nix = {
url = "github:input-output-hk/haskell.nix";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.follows = "haskell-nix/nixpkgs-unstable";
CHaP = {
url = "github:intersectmbo/cardano-haskell-packages?ref=repo";
flake = false;
};
iohk-nix = {
url = "github:input-output-hk/iohk-nix";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs = { self, ogmios-src, nixpkgs, haskell-nix, iohk-nix, CHaP, ... }:
let
defaultSystems = [
"x86_64-linux"
"x86_64-darwin"
"aarch64-linux"
"aarch64-darwin"
];
perSystem = nixpkgs.lib.genAttrs defaultSystems;
nixpkgsFor = system: import nixpkgs {
overlays = [
iohk-nix.overlays.crypto
haskell-nix.overlay
iohk-nix.overlays.haskell-nix-crypto
];
inherit (haskell-nix) config;
inherit system;
};
projectFor = { system }:
let
pkgs = nixpkgsFor system;
cleanSource =
nixpkgs.lib.cleanSourceWith {
name = "ogmios-src-clean";
src = "${ogmios-src}/server";
filter = path: type: builtins.all (x: x) [ (baseNameOf path != "package.yaml") ];
};
in
pkgs.haskell-nix.cabalProject {
src = cleanSource;
inputMap = {
"https://input-output-hk.github.io/cardano-haskell-packages" = CHaP;
};
name = "ogmios";
compiler-nix-name = "ghc966";
shell = {
inputsFrom = [ pkgs.libsodium-vrf ];
exactDeps = true;
nativeBuildInputs = [ pkgs.libsodium-vrf pkgs.secp256k1 ];
};
sha256map =
{
"https://github.com/CardanoSolutions/cardano-ledger"."f051a2ed0db076a869d14643a65ce6e8250b6324" = "1zi91lzms5kyjmc7r0p12hrvyg34dyqcvz3bkvsw9djjj4gngkbf";
};
modules = [{
packages = {
cardano-crypto-praos.components.library.pkgconfig =
pkgs.lib.mkForce [ [ pkgs.libsodium-vrf ] ];
cardano-crypto-class.components.library.pkgconfig =
pkgs.lib.mkForce [ [ pkgs.libsodium-vrf pkgs.secp256k1 pkgs.libblst ] ];
};
}];
};
in
{
flake = perSystem (system: (projectFor { inherit system; }).flake { });
defaultPackage = perSystem (system:
self.flake.${system}.packages."ogmios:exe:ogmios"
);
packages = perSystem (system:
builtins.removeAttrs self.flake.${system}.packages [
"hjsonschema:test:local"
"hjsonschema:test:remote"
"hjsonschema:test:spec"
]
);
devShell = perSystem (system: self.flake.${system}.devShell);
herculesCI.ciSystems = [ "x86_64-linux" "x86_64-darwin" ];
};
}