-
Notifications
You must be signed in to change notification settings - Fork 0
/
flake.nix
72 lines (69 loc) · 2.14 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
{
description = "melange-relay Nix Flake";
inputs.nix-filter.url = "github:numtide/nix-filter";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs = {
url = "github:nix-ocaml/nix-overlays";
inputs.flake-utils.follows = "flake-utils";
};
inputs.melange = {
url = "github:melange-re/melange";
inputs.nix-filter.follows = "nix-filter";
inputs.flake-utils.follows = "flake-utils";
inputs.nixpkgs.follows = "nixpkgs";
};
outputs = { self, nixpkgs, flake-utils, nix-filter, melange }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}".appendOverlays [
(self: super: {
ocamlPackages = super.ocaml-ng.ocamlPackages_5_1;
})
melange.overlays.default
];
inherit (pkgs) nodejs_latest lib stdenv darwin;
in
rec {
packages = {
default = with pkgs.ocamlPackages; buildDunePackage {
pname = "melange-relay";
version = "dev";
src = ./.;
nativeBuildInputs = [
pkgs.ocamlPackages.melange
reason
];
nativeCheckInputs = [ nodejs_latest ];
checkInputs = [ melange-fetch nodejs_latest ];
doCheck = true;
propagatedBuildInputs = [
pkgs.ocamlPackages.melange
reason-react
reason-react-ppx
graphql_parser
];
};
};
defaultPackage = packages.native.piaf;
devShells.default = pkgs.mkShell {
inputsFrom = [ packages.default ];
nativeBuildInputs = with pkgs; [
pkg-config
yarn
cargo
nodejs_latest
rustfmt
] ++ (with pkgs.ocamlPackages; [
ocamlformat
merlin
]);
propagatedBuildInputs = lib.optionals stdenv.isDarwin [
pkgs.libiconv
darwin.apple_sdk.frameworks.Security
];
shellHook = ''
PATH=$PATH:$PWD/melange-relay-compiler/compiler/target/debug
'';
};
});
}