Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
1.8 kB · 89 lines
Nix
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990{ lib, ocaml, buildDunePackage, lsp, xdg, re, fiber, makeWrapper, dot-merlin-reader, spawn, ocamlc-loc, merlin, merlin-lib, astring, camlp-streams, base,}:
# Freeze ocaml-lsp-version at 1.17.0 for OCaml 5.0# for which merlin 4.16 is not availablelet lsp_v = if lib.versions.majorMinor ocaml.version == "5.0" then lsp.override { version = "1.17.0"; } else lsp;in
let lsp = lsp_v;in
# Use merlin < 4.17 for OCaml < 5.2let merlin-lib_v = if lib.versions.majorMinor ocaml.version == "4.14" then merlin-lib.override { merlin = merlin.override { version = "4.16-414"; }; } else if lib.versions.majorMinor ocaml.version == "5.1" then merlin-lib.override { merlin = merlin.override { version = "4.16-501"; }; } else merlin-lib;inlet merlin-lib = merlin-lib_v;in
buildDunePackage rec { pname = "ocaml-lsp-server"; inherit (lsp) version src preBuild;
buildInputs = lsp.buildInputs ++ [ lsp re ] ++ lib.optional (lib.versionAtLeast version "1.9") spawn ++ lib.optionals (lib.versionAtLeast version "1.10") [ fiber xdg ] ++ lib.optional (lib.versionAtLeast version "1.14.2") ocamlc-loc ++ lib.optionals (lib.versionAtLeast version "1.17.0") [ astring camlp-streams merlin-lib ] ++ lib.optional (lib.versionAtLeast version "1.18.0") base;
nativeBuildInputs = [ makeWrapper ];
postInstall = '' wrapProgram $out/bin/ocamllsp --prefix PATH : ${dot-merlin-reader}/bin '';
meta = lsp.meta // { description = "OCaml Language Server Protocol implementation"; mainProgram = "ocamllsp"; };}