forked from ocaml/ocaml-lsp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
shell.nix
38 lines (36 loc) · 1.03 KB
/
shell.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
let
pkgs = (import <nixpkgs> { });
local = (import ./default.nix { });
inherit (pkgs) stdenv lib;
ocamlformat =
let
ocamlformat_version =
let
lists = pkgs.lib.lists;
strings = pkgs.lib.strings;
ocamlformat_config = strings.splitString "\n" (builtins.readFile ./.ocamlformat);
prefix = "version=";
ocamlformat_version_pred = line: strings.hasPrefix prefix line;
version_line = lists.findFirst ocamlformat_version_pred "not_found" ocamlformat_config;
version = strings.removePrefix prefix version_line;
in
builtins.replaceStrings ["."] ["_"] version;
in builtins.getAttr ("ocamlformat_" + ocamlformat_version) pkgs;
in with local;
pkgs.mkShell {
inputsFrom = [ jsonrpc lsp ocaml-lsp-server ];
buildInputs = (with pkgs; [
yarn
nodejs-14_x
gnumake
ocamlPackages.ocaml-lsp
]) ++ [ocamlformat] ++ (with opam; [
# dev
cinaps
menhir
ppx_yojson_conv
# test
ppx_expect
ocamlformat-rpc
]);
}