-
Notifications
You must be signed in to change notification settings - Fork 75
/
flake.nix
80 lines (78 loc) · 2.37 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
{
description = "vscode-ocaml-platform Nix Flake";
inputs.nix-filter.url = "github:numtide/nix-filter";
inputs.flake-utils.url = "github:numtide/flake-utils";
inputs.nixpkgs.url = "github:nixos/nixpkgs";
inputs.jsonoo.url = "github:mnxn/jsonoo";
inputs.jsonoo.flake = false;
outputs = { self, nixpkgs, flake-utils, nix-filter, ... }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
config = { allowUnfree = true; };
};
inherit (pkgs.ocamlPackages) buildDunePackage;
jsonoo = buildDunePackage {
pname = "jsonoo";
version = "n/a";
src = inputs.jsonoo;
nativeBuildInputs = [ pkgs.ocamlPackages.gen_js_api ];
propagatedBuildInputs =
(with pkgs.ocamlPackages; [
js_of_ocaml
js_of_ocaml-ppx
gen_js_api
]);
duneVersion = "3";
};
in
rec {
packages = rec {
default = vscode-ocaml-platform;
vscode = buildDunePackage {
pname = "vscode";
version = "n/a";
src = ./.;
duneVersion = "3";
propagatedBuildInputs = with pkgs.ocamlPackages; [
js_of_ocaml
gen_js_api
promise_jsoo
jsonoo
];
checkInputs = with pkgs.ocamlPackages; [ ];
doCheck = true;
};
vscode-ocaml-platform = buildDunePackage {
pname = "vscode-ocaml-platform";
inherit (packages.vscode) src version;
propagatedBuildInputs = [ packages.vscode jsonoo ] ++
(with pkgs.ocamlPackages; [
js_of_ocaml
gen_js_api
base
promise_jsoo
ocaml-version
ppxlib
opam-file-format
]);
duneVersion = "3";
};
};
devShells.default = pkgs.mkShell {
inputsFrom = pkgs.lib.attrValues packages;
buildInputs = with pkgs.ocamlPackages; [
pkgs.yarn-berry
jsonoo
ocaml-lsp
pkgs.ocamlformat_0_26_2
pkgs.vscode
pkgs.nodePackages.parcel
];
shellHook = ''
make npm-deps
'';
};
});
}