forked from reasonml/reason-react
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathflake.nix
75 lines (70 loc) · 2.28 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
{
description = "Reason React Nix Flake";
inputs = {
nix-filter.url = "github:numtide/nix-filter";
flake-utils.url = "github:numtide/flake-utils";
nixpkgs = {
url = "github:nix-ocaml/nix-overlays";
inputs.flake-utils.follows = "flake-utils";
};
};
outputs = { self, nixpkgs, flake-utils, nix-filter }:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages."${system}".appendOverlays [
(self: super: { ocamlPackages = super.ocaml-ng.ocamlPackages_5_1; })
];
in
rec {
packages = with pkgs.ocamlPackages; rec {
reason-react-ppx = buildDunePackage {
pname = "reason-react-ppx";
version = "n/a";
src = with nix-filter.lib; filter {
root = ./.;
include = [
"dune-project"
"dune"
"reason-react-ppx.opam"
"reason-react.opam"
"ppx"
];
};
# Due to a Reason version mismatch, the generated OCaml PPX diff
# looks different
doCheck = false;
nativeCheckInputs = [ reason ];
propagatedBuildInputs = [ ppxlib ];
};
reason-react = buildDunePackage {
pname = "reason-react";
version = "n/a";
src = with nix-filter.lib; filter {
root = ./.;
include = [
"dune-project"
"dune"
"reason-react-ppx.opam"
"reason-react.opam"
"src"
"test"
];
};
doCheck = true;
nativeBuildInputs = [ pkgs.ocamlPackages.melange reason ];
propagatedBuildInputs = [
pkgs.ocamlPackages.melange
reason-react-ppx
];
};
} // { default = packages.reason-react; };
devShells = {
default = pkgs.mkShell {
dontDetectOcamlConflicts = true;
inputsFrom = pkgs.lib.attrValues packages;
nativeBuildInputs = with pkgs.ocamlPackages; [ ocamlformat pkgs.nodejs_latest ];
propagatedBuildInputs = with pkgs.ocamlPackages; [ merlin ];
};
};
});
}