-
Notifications
You must be signed in to change notification settings - Fork 1
/
flake.nix
76 lines (72 loc) · 2.01 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
{
description = "An AFRP library based on Netwire";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
flake-utils.url = "github:numtide/flake-utils";
};
outputs =
{
nixpkgs,
flake-utils,
...
}:
flake-utils.lib.eachDefaultSystem (
system:
let
version = "0.1";
dune_src =
prev:
prev.fetchFromGitHub {
owner = "ocaml";
repo = "dune";
rev = "34de4d1264240f2bddeda4128a2bd285488341ab";
hash = "sha256-kO9nwa0RrOZvpLvISuqyRDl+g1sJ7IGnpbF0el+MCn8=";
};
overlay = (
final: prev: {
dune_3 = prev.dune_3.overrideAttrs (old: {
src = dune_src prev;
});
ocamlPackages = prev.ocamlPackages.overrideScope (
ofinal: oprev: {
netwire = final.ocamlPackages.callPackage ./. { inherit version; };
netwireUnix = final.ocamlPackages.callPackage ./netwireUnix.nix {
inherit version;
};
netwireJs = final.ocamlPackages.callPackage ./netwireJs.nix {
inherit version;
};
dune_3 = oprev.dune_3.overrideAttrs (old: {
src = dune_src prev;
});
}
);
}
);
pkgs = import nixpkgs {
inherit system;
overlays = [
overlay
];
};
in
{
packages = {
default = pkgs.ocamlPackages.netwire;
inherit (pkgs.ocamlPackages) netwire netwireJs netwireUnix;
};
devShells.default = pkgs.mkShell {
inputsFrom = [
pkgs.ocamlPackages.netwire
];
buildInputs = [
pkgs.ocamlPackages.ocaml-lsp
pkgs.ocamlPackages.utop
pkgs.ocamlPackages.ocamlformat
pkgs.ocamlPackages.ocaml-print-intf
pkgs.opam
];
};
}
);
}